0ea8589b9199fde82ec05b1b25e6c4ec2514fa1b
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-11-17  Zalan Bujtas  <zalan@apple.com>
2
3         Simple line layout: Add letter-spacing support.
4         https://bugs.webkit.org/show_bug.cgi?id=151362
5
6         Reviewed by Antti Koivisto.
7
8         This enables us to use simple line layout on letter-spacing content.
9         (fixme: webkit.org/b/151368 -> Repaint rect is not computed correctly when negative letter-spacing applied)
10
11         Test: fast/text/simple-line-letterspacing.html
12
13         * rendering/SimpleLineLayout.cpp:
14         (WebCore::SimpleLineLayout::canUseForStyle):
15         * rendering/SimpleLineLayoutFunctions.cpp:
16         (WebCore::SimpleLineLayout::paintFlow): RenderLineBoxList tests vertical intersection only. 
17         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
18         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
19
20 2015-11-17  Per Arne Vollan  <peavo@outlook.com>
21
22         [WinCairo][MediaFoundation] Current playback time is not shown.
23         https://bugs.webkit.org/show_bug.cgi?id=151357
24
25         Reviewed by Alex Christensen.
26
27         We need to implement the currentTime() method.
28
29         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
30         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
31         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
32         (WebCore::MediaPlayerPrivateMediaFoundation::paused):
33         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame):
34         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
35         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
36         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
37
38 2015-11-17  Zalan Bujtas  <zalan@apple.com>
39
40         Split SimpleLineLayout::canUseFor into canUseForStyle and canUseForFontAndText.
41         https://bugs.webkit.org/show_bug.cgi?id=151338
42
43         Reviewed by Myles C. Maxfield.
44
45         No change in functionality.
46
47         * rendering/SimpleLineLayout.cpp:
48         (WebCore::SimpleLineLayout::canUseForFontAndText):
49         (WebCore::SimpleLineLayout::canUseForStyle):
50         (WebCore::SimpleLineLayout::canUseFor):
51
52 2015-11-17  Brady Eidson  <beidson@apple.com>
53
54         Modern IDB: Support IDBObjectStore.indexNames.
55         https://bugs.webkit.org/show_bug.cgi?id=151341
56
57         Reviewed by Alex Christensen.
58
59         No new tests (Covered by existing storage/indexeddb/modern/objectstore-attributes.html).
60
61         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
62         (WebCore::IDBClient::IDBObjectStore::indexNames):
63         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
64         (WebCore::IDBObjectStoreInfo::indexNames):
65         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
66
67 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
68
69         ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
70         https://bugs.webkit.org/show_bug.cgi?id=151025
71
72         Reviewed by Darin Adler.
73
74         Negative margins could make RenderFlexibleBox compute negative
75         intrinsic sizes. Clamp intrinsic sizes to 0.
76
77         Test: css3/flexbox/negative-margins-assert.html
78
79         * rendering/RenderFlexibleBox.cpp:
80         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
81
82 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
83
84         [css-grid] Fix alignment with gutters and negative free spaces
85         https://bugs.webkit.org/show_bug.cgi?id=151307
86
87         Reviewed by Zalan Bujtas.
88
89         This is a regression caused by r192154. The problem was that
90         the free space was not properly computed when the grid
91         container was narrower than the track sizes + gutters size for
92         a given axis. The culprit was an unneeded clamp to 0 which was
93         polluting the freeSpace computation as the track sizing
94         algorithm works perfectly OK with negative freeSpace values.
95
96         * rendering/RenderGrid.cpp:
97         (WebCore::RenderGrid::computeTrackSizesForDirection):
98
99 2015-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
100
101         [GStreamer] Use RunLoop instead of GMainLoop in AudioFileReaderGStreamer
102         https://bugs.webkit.org/show_bug.cgi?id=151256
103
104         Reviewed by Žan Doberšek.
105
106         Use RunLoop instead of the platform specific code. The AudioBus
107         can be created from any thread, so we create a helper thread to
108         ensure we don't use the main RunLoop.
109
110         This patch also includes some code cleanups:
111           - Uses smart pointers when possible.
112           - Fixes uninitialized members in constructors.
113           - Makes private members private.
114           - Uses lambdas instead of static non-members functions.
115           - nullptr instead of 0 in some places.
116
117         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
118         (WebCore::AudioFileReader::createWeakPtr):
119         (WebCore::AudioFileReader::deinterleavePadAddedCallback):
120         (WebCore::AudioFileReader::deinterleaveReadyCallback):
121         (WebCore::AudioFileReader::decodebinPadAddedCallback):
122         (WebCore::AudioFileReader::AudioFileReader):
123         (WebCore::AudioFileReader::~AudioFileReader):
124         (WebCore::AudioFileReader::handleSample):
125         (WebCore::AudioFileReader::handleMessage):
126         (WebCore::AudioFileReader::handleNewDeinterleavePad):
127         (WebCore::AudioFileReader::deinterleavePadsConfigured):
128         (WebCore::AudioFileReader::plugDeinterleave):
129         (WebCore::AudioFileReader::decodeAudioForBusCreation):
130         (WebCore::AudioFileReader::createBus):
131         (WebCore::createBusFromAudioFile):
132         (WebCore::createBusFromInMemoryAudioFile):
133         (WebCore::onAppsinkPullRequiredCallback): Deleted.
134         (WebCore::messageCallback): Deleted.
135         (WebCore::onGStreamerDeinterleavePadAddedCallback): Deleted.
136         (WebCore::onGStreamerDeinterleaveReadyCallback): Deleted.
137         (WebCore::onGStreamerDecodebinPadAddedCallback): Deleted.
138         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
139         (WTF::adoptGRef):
140         (WTF::refGPtr<GstBufferList>):
141         (WTF::derefGPtr<GstBufferList>):
142         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
143
144 2015-11-16  Eric Carlson  <eric.carlson@apple.com>
145
146         [MediaStream] VideoTrack should respond to MediaStreamTrack state changes
147         https://bugs.webkit.org/show_bug.cgi?id=151299
148
149         Reviewed by Jer Noble.
150
151         Test: fast/mediastream/MediaStream-video-element-track-stop.html
152
153         * Modules/mediastream/MediaStreamTrack.cpp:
154         (WebCore::MediaStreamTrack::ended): Check m_ended.
155         (WebCore::MediaStreamTrack::stopProducingData): Set m_ended before telling private track to 
156           stop so we won't fire an 'ended' event.
157         (WebCore::MediaStreamTrack::trackEnded): Set m_ended, add comments from spec.
158         * Modules/mediastream/MediaStreamTrack.h:
159
160         * html/HTMLMediaElement.cpp:
161         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Live streams have infinite duration,
162           not indefinite.
163
164         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
165         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
166         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Return NULL when displayMode
167           is None.
168         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Calculate current 
169           displayMode based on MediaStream state.
170         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Renamed from 
171           setPausedImageVisible, use m_displayMode. Don't start/stop clock, it makes more sense
172           to do that in play and pause.
173         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start clock. 
174         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stop clock.
175         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Call updateDisplayMode.
176         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Ditto.
177         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize):
178         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Always try to create
179           both layers if necessary.
180         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::renderingModeChanged): New, update displayMode
181           and call back to the media element.
182         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
183         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Get rid of some unused locals.
184           React to a change in the enabled video track.
185         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Paint black when
186           the active video track is disabled.
187         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPausedImageVisible): Deleted.
188
189         * platform/mediastream/MediaStreamPrivate.cpp:
190         (WebCore::MediaStreamPrivate::updateActiveState): Split the logic of updating the active video
191           track out into updateActiveVideoTrack.
192         (WebCore::MediaStreamPrivate::hasVideo): Check for track.ended.
193         (WebCore::MediaStreamPrivate::hasAudio): Ditto.
194         (WebCore::MediaStreamPrivate::paintCurrentFrameInContext): Don't call the source directly.
195         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): New.
196         (WebCore::MediaStreamPrivate::trackEnabledChanged): Call updateActiveVideoTrack.
197         (WebCore::MediaStreamPrivate::trackEnded): new.
198         * platform/mediastream/MediaStreamPrivate.h:
199
200         * platform/mediastream/MediaStreamTrackPrivate.cpp:
201         (WebCore::MediaStreamTrackPrivate::setEnabled): Call observers if enabled state changes.
202         (WebCore::MediaStreamTrackPrivate::endTrack): Call observers.
203         (WebCore::MediaStreamTrackPrivate::paintCurrentFrameInContext): New.
204         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping): Add comments.
205         * platform/mediastream/MediaStreamTrackPrivate.h:
206
207         * platform/mock/MockRealtimeVideoSource.cpp:
208         (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext): Remove a commented-out line.
209
210 2015-11-16  Pranjal Jumde  <pjumde@apple.com>
211
212         Fixes the buffer-overflow when reading characters from textRun
213         https://bugs.webkit.org/attachment.cgi?bugid=151055
214         <rdar://problem/23251789>
215
216         Reviewed by Brent Fulgham.
217
218         * platform/graphics/FontCascade.cpp
219
220 2015-11-16  Brady Eidson  <beidson@apple.com>
221
222         Modern IDB:Make in-memory ObjectStore cursors work.
223         https://bugs.webkit.org/show_bug.cgi?id=151196
224
225         Reviewed by Darin Adler.
226
227         Tests: storage/indexeddb/modern/cursor-2.html
228                storage/indexeddb/modern/cursor-3.html
229                storage/indexeddb/modern/cursor-4.html
230                storage/indexeddb/modern/cursor-5.html
231                storage/indexeddb/modern/cursor-6.html
232                storage/indexeddb/modern/cursor-7.html
233                storage/indexeddb/modern/cursor-8.html
234                storage/indexeddb/modern/objectstore-cursor-advance-failures.html
235                storage/indexeddb/modern/objectstore-cursor-continue-failures.html
236
237         Object store cursors directly hold on to a std::set<>::iterator to act as the cursor.
238         
239         The object store tells all of its cursors when it is cleared or records are deleted
240         so the cursors can invalidate their iterators as needed.
241         
242         In case of such invalidation, the cursor hangs on to the current key value so it can 
243         pick up where it left off in case it is iterated.
244
245         * CMakeLists.txt:
246         * WebCore.xcodeproj/project.pbxproj:
247
248         * Modules/indexeddb/IDBGetResult.h:
249         (WebCore::IDBGetResult::isolatedCopy):
250         
251         * Modules/indexeddb/IDBKeyRangeData.cpp:
252         (WebCore::IDBKeyRangeData::containsKey):
253         (WebCore::IDBKeyRangeData::loggingString):
254         * Modules/indexeddb/IDBKeyRangeData.h:
255         
256         * Modules/indexeddb/client/IDBAnyImpl.cpp:
257         (WebCore::IDBClient::IDBAny::modernIDBCursor):
258         
259         * Modules/indexeddb/client/IDBCursorImpl.cpp:
260         (WebCore::IDBClient::IDBCursor::update):
261         (WebCore::IDBClient::IDBCursor::advance):
262         (WebCore::IDBClient::IDBCursor::continueFunction):
263         (WebCore::IDBClient::IDBCursor::setGetResult):
264         * Modules/indexeddb/client/IDBCursorImpl.h:
265         
266         * Modules/indexeddb/client/IDBRequestImpl.cpp:
267         (WebCore::IDBClient::IDBRequest::dispatchEvent):
268         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
269         * Modules/indexeddb/client/IDBRequestImpl.h:
270         (WebCore::IDBClient::IDBRequest::pendingCursor):
271         
272         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
273         (WebCore::IDBClient::IDBTransaction::addRequest): Deleted.
274         
275         * Modules/indexeddb/client/TransactionOperation.cpp:
276         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
277         * Modules/indexeddb/client/TransactionOperation.h:
278         (WebCore::IDBClient::TransactionOperation::cursorIdentifier):
279         
280         * Modules/indexeddb/server/IDBBackingStore.h:
281         
282         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
283         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
284         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
285         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
286         
287         * Modules/indexeddb/server/MemoryCursor.cpp: Added.
288         (WebCore::IDBServer::cursorMap):
289         (WebCore::IDBServer::MemoryCursor::MemoryCursor):
290         (WebCore::IDBServer::MemoryCursor::~MemoryCursor):
291         (WebCore::IDBServer::MemoryCursor::cursorForIdentifier):
292         * Modules/indexeddb/server/MemoryCursor.h: Added.
293         
294         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
295         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
296         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
297         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
298         
299         * Modules/indexeddb/server/MemoryObjectStore.cpp:
300         (WebCore::IDBServer::MemoryObjectStore::clear):
301         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
302         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
303         (WebCore::IDBServer::MemoryObjectStore::addRecord):
304         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
305         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForDeleteRecord):
306         (WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor):
307         * Modules/indexeddb/server/MemoryObjectStore.h:
308         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
309         
310         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: Added.
311         (WebCore::IDBServer::MemoryObjectStoreCursor::create):
312         (WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor):
313         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
314         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
315         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
316         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
317         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange):
318         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange):
319         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
320         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
321         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
322         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition):
323         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
324         * Modules/indexeddb/server/MemoryObjectStoreCursor.h: Added.
325
326         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
327         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
328         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
329         * Modules/indexeddb/server/UniqueIDBDatabase.h:
330
331         * Modules/indexeddb/shared/IDBCursorInfo.h:
332         (WebCore::IDBCursorInfo::range):
333
334         * Modules/indexeddb/shared/IDBRequestData.cpp:
335         (WebCore::IDBRequestData::IDBRequestData):
336         (WebCore::IDBRequestData::cursorIdentifier):
337         * Modules/indexeddb/shared/IDBRequestData.h:
338
339 2015-11-16  Anders Carlsson  <andersca@apple.com>
340
341         Add identifier strings for a bunch of context menu items
342         https://bugs.webkit.org/show_bug.cgi?id=151272
343
344         Reviewed by Dan Bernstein.
345
346         Have NSMenuItem conform to NSUserInterfaceItemIdentification.
347
348         * platform/spi/mac/NSMenuSPI.h:
349
350 2015-11-16  Jiewen Tan  <jiewen_tan@apple.com>
351
352         Null-pointer dereference in WebCore::firstEditablePositionAfterPositionInRoot
353         https://bugs.webkit.org/show_bug.cgi?id=151288
354         <rdar://problem/23450367>
355
356         Reviewed by Darin Adler.
357
358         Some problematic organization of body element could cause problems to JustifyRight
359         and Indent commnads.
360
361         Tests: editing/execCommand/justify-right-then-indent-with-problematic-body.html
362                editing/execCommand/justify-right-with-problematic-body.html
363
364         * editing/CompositeEditCommand.cpp:
365         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
366         Assertion at l1017 is not held anymore with the testcase:
367         editing/execCommand/justify-right-with-problematic-body.html.
368         Therefore, change it to an if statement.
369         Also, add a guardance before calling insertNewDefaultParagraphElementAt()
370         as insertNodeAt() requires an editable position.
371         (WebCore::CompositeEditCommand::moveParagraphWithClones):
372         Add a guardance before calling insertNodeAt() as it requires an editable position.
373         * editing/htmlediting.cpp:
374         (WebCore::firstEditablePositionAfterPositionInRoot):
375         (WebCore::lastEditablePositionBeforePositionInRoot):
376
377 2015-11-16  Simon Fraser  <simon.fraser@apple.com>
378
379         Sort the Xcode project files.
380
381         * WebCore.xcodeproj/project.pbxproj:
382
383 2015-11-16  Sebastian Dröge  <sebastian@centricular.com>
384
385         WebRTC: Expose RTCPeerConnectionInternals functions to JS builtins.
386         https://bugs.webkit.org/show_bug.cgi?id=151302
387
388         Reviewed by Youenn Fablet.
389
390         * bindings/js/JSDOMWindowBase.cpp:
391         (WebCore::JSDOMWindowBase::finishCreation):
392         Expose RTCPeerConnectionInternals functions to JS builtins.
393
394 2015-11-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
395
396         [Streams API] Update the implementation up to spec of Nov 11 2015
397         https://bugs.webkit.org/show_bug.cgi?id=151195
398
399         Reviewed by Youenn Fablet.
400
401         Updated the implementation of Readable and Writable Streams to the latest changes in the spec. Main changes are
402         the removal of the error and the state from the reader, readers are not automatically released and then minor or
403         style changes.
404
405         Implementation is up to date with version
406         https://github.com/whatwg/streams/commit/48c8a3c30ea7e76c5e4eb9f157a438dd755bcc8e.
407
408         Tests: streams/reference-implementation/readable-stream-templated.html
409                streams/reference-implementation/readable-stream-reader.html
410
411         * Modules/streams/ReadableStream.js:
412         (getReader): Removed check for locked stream.
413         * Modules/streams/ReadableStreamInternals.js:
414         (privateInitializeReadableStreamReader): Removed setting @error and @state and initialized owner and owner's
415         reader as per spec.
416         (teeReadableStreamPullFunction): Added assertions.
417         (isReadableStreamReader): Added comment about resetting the reader owner to null instead of undefined as a means
418         to distinguish between not having the slot and having it unset.
419         (finishClosingReadableStream): Inline @closeReadableStreamReader as it is used only here now.
420         (readFromReadableStreamReader): Reworked the state and error to use the stream one and changed the conditions to
421         pull again as per spec.
422         (errorReadableStream): Not releasing the reader and removed the reader error and state management.
423         (releaseReadableStreamReader): Deleted.
424         (closeReadableStreamReader): Deleted.
425         * Modules/streams/ReadableStreamReader.js:
426         (cancel): Removed some checks and assertions as per spec.
427         (read): Added check for owner.
428         (releaseLock): No closing the reader and rejecting close promise and unlinking reader and owner instead.
429         * Modules/streams/WritableStream.js:
430         (abort): Style change.
431         * Modules/streams/WritableStreamInternals.js:
432         (writableStreamAdvanceQueue):
433         (closeWritableStream): Used @call instead of @apply.
434
435 2015-11-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
436
437         WebRTC: Update RTCPeerConnection API and introduce PeerConnectionBackend
438         https://bugs.webkit.org/show_bug.cgi?id=150166
439
440         Reviewed by Eric Carlson and Youenn Fablet
441
442         This change introduces PeerConnectionBackend which is a WebCore interface
443         that allows RTCPeerConnection to have platform abstractions at different
444         levels. For example, the MediaEndpoint interface [1] is a lower level
445         WebRTC backend abstraction where a big part of the WebRTC specification
446         is implemented in WebCore to be reusable. RTCPeerConnectionHandler (in
447         the repo today) is on the other hand a higher level WebRTC backend
448         abstraction where the calls are mostly forwarded directly to the
449         backend. The PeerConnectionBackend interface facilitates both approaches.
450
451         RTCPeerConnection
452          | (has)
453          |
454         PeerConnectionBackend
455          |   |
456          |   | (realizes)
457          |  MediaEndpointPeerConnection
458          |   | (has)
459          |   |
460          |  MediaEndpoint (platform interface)
461          |
462          | (realizes)
463         RTCPeerHandlerPeerConnection
464          | (has)
465          |
466         RCPeerConnectionHandler (existing platform interface)
467
468         Notable changes:
469
470         # Overloaded methods on RTCPeerConnection (Promise + legacy callback
471         signatures) are implemented with JSBuiltins.
472
473         # "Queued operations" ([1] Section 4.3.1) is implemented in JS bindings
474         with Promises.
475
476         # New RTCPeerConnection features
477          - add/removeTrack()
478          - pending/currentLocal/RemoteDescription attributes
479          - RTCRtpSender/Receiver
480
481         # Information carrying objects like RTCSessionDescription and
482         RTCCandidate don't encapsulate a "mirrored" platform object anymore.
483
484         # Remove RTCPeerConnection specific callback implementations (not used
485         with JS bindings)
486
487         [1] http://webkit.org/b/150165
488         [2] https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html
489
490         Tests: Mock should be added to test future WebRTC backend abstractions.
491
492         * CMakeLists.txt:
493         * DerivedSources.make:
494         * Modules/mediastream/PeerConnectionBackend.cpp: Added.
495         (WebCore::createPeerConnectionBackend):
496         * Modules/mediastream/PeerConnectionBackend.h: Added.
497         (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient):
498         (WebCore::PeerConnectionBackend::~PeerConnectionBackend):
499         * Modules/mediastream/PeerConnectionStates.h: Added.
500         * Modules/mediastream/RTCConfiguration.cpp: Added.
501         (WebCore::validateIceServerURL):
502         (WebCore::parseIceServer):
503         (WebCore::RTCConfiguration::create):
504         (WebCore::RTCConfiguration::RTCConfiguration):
505         (WebCore::RTCConfiguration::initialize):
506         * Modules/mediastream/RTCConfiguration.h:
507         (WebCore::RTCConfiguration::iceTransportPolicy):
508         (WebCore::RTCConfiguration::bundlePolicy):
509         (WebCore::RTCConfiguration::iceServers):
510         (WebCore::RTCConfiguration::create): Deleted.
511         (WebCore::RTCConfiguration::appendServer): Deleted.
512         (WebCore::RTCConfiguration::numberOfServers): Deleted.
513         (WebCore::RTCConfiguration::server): Deleted.
514         (WebCore::RTCConfiguration::iceTransports): Deleted.
515         (WebCore::RTCConfiguration::setIceTransports): Deleted.
516         (WebCore::RTCConfiguration::requestIdentity): Deleted.
517         (WebCore::RTCConfiguration::setRequestIdentity): Deleted.
518         (WebCore::RTCConfiguration::privateConfiguration): Deleted.
519         (WebCore::RTCConfiguration::RTCConfiguration): Deleted.
520         * Modules/mediastream/RTCConfiguration.idl:
521         * Modules/mediastream/RTCIceCandidate.cpp:
522         (WebCore::RTCIceCandidate::create):
523         (WebCore::RTCIceCandidate::RTCIceCandidate):
524         (WebCore::RTCIceCandidate::~RTCIceCandidate): Deleted.
525         (WebCore::RTCIceCandidate::candidate): Deleted.
526         (WebCore::RTCIceCandidate::sdpMid): Deleted.
527         (WebCore::RTCIceCandidate::sdpMLineIndex): Deleted.
528         (WebCore::RTCIceCandidate::descriptor): Deleted.
529         * Modules/mediastream/RTCIceCandidate.h:
530         (WebCore::RTCIceCandidate::~RTCIceCandidate):
531         (WebCore::RTCIceCandidate::candidate):
532         (WebCore::RTCIceCandidate::setCandidate):
533         (WebCore::RTCIceCandidate::sdpMid):
534         (WebCore::RTCIceCandidate::setSdpMid):
535         (WebCore::RTCIceCandidate::sdpMLineIndex):
536         (WebCore::RTCIceCandidate::setSdpMLineIndex):
537         * Modules/mediastream/RTCIceCandidate.idl:
538         * Modules/mediastream/RTCIceCandidateEvent.cpp:
539         (WebCore::RTCIceCandidateEvent::create):
540         (WebCore::RTCIceCandidateEvent::RTCIceCandidateEvent):
541         * Modules/mediastream/RTCIceCandidateEvent.h:
542         * Modules/mediastream/RTCIceServer.h:
543         (WebCore::RTCIceServer::urls):
544         (WebCore::RTCIceServer::credential):
545         (WebCore::RTCIceServer::username):
546         (WebCore::RTCIceServer::RTCIceServer):
547         (WebCore::RTCIceServer::create): Deleted.
548         (WebCore::RTCIceServer::privateServer): Deleted.
549         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
550         (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions):
551         (WebCore::RTCOfferAnswerOptions::initialize):
552         (WebCore::RTCOfferOptions::RTCOfferOptions):
553         (WebCore::RTCOfferOptions::initialize):
554         (WebCore::RTCAnswerOptions::create):
555         (WebCore::RTCAnswerOptions::initialize):
556         (WebCore::RTCOfferAnswerOptions::create): Deleted.
557         * Modules/mediastream/RTCOfferAnswerOptions.h:
558         (WebCore::RTCOfferAnswerOptions::voiceActivityDetection):
559         (WebCore::RTCOfferOptions::offerToReceiveVideo):
560         (WebCore::RTCOfferOptions::offerToReceiveAudio):
561         (WebCore::RTCOfferOptions::iceRestart):
562         (WebCore::RTCAnswerOptions::RTCAnswerOptions):
563         (WebCore::RTCOfferAnswerOptions::requestIdentity): Deleted.
564         (WebCore::RTCOfferAnswerOptions::privateOfferAnswerOptions): Deleted.
565         (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions): Deleted.
566         (WebCore::RTCOfferOptions::voiceActivityDetection): Deleted.
567         (WebCore::RTCOfferOptions::privateOfferOptions): Deleted.
568         (WebCore::RTCOfferOptions::~RTCOfferOptions): Deleted.
569         (WebCore::RTCOfferOptions::RTCOfferOptions): Deleted.
570         * Modules/mediastream/RTCPeerConnection.cpp:
571         (WebCore::RTCPeerConnection::create):
572         (WebCore::RTCPeerConnection::RTCPeerConnection):
573         (WebCore::RTCPeerConnection::getSenders):
574         (WebCore::RTCPeerConnection::getReceivers):
575         (WebCore::RTCPeerConnection::addTrack):
576         (WebCore::RTCPeerConnection::removeTrack):
577         (WebCore::RTCPeerConnection::queuedCreateOffer):
578         (WebCore::RTCPeerConnection::queuedCreateAnswer):
579         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
580         (WebCore::RTCPeerConnection::localDescription):
581         (WebCore::RTCPeerConnection::currentLocalDescription):
582         (WebCore::RTCPeerConnection::pendingLocalDescription):
583         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
584         (WebCore::RTCPeerConnection::remoteDescription):
585         (WebCore::RTCPeerConnection::currentRemoteDescription):
586         (WebCore::RTCPeerConnection::pendingRemoteDescription):
587         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
588         (WebCore::RTCPeerConnection::signalingState):
589         (WebCore::RTCPeerConnection::iceGatheringState):
590         (WebCore::RTCPeerConnection::iceConnectionState):
591         (WebCore::RTCPeerConnection::setConfiguration):
592         (WebCore::RTCPeerConnection::privateGetStats):
593         (WebCore::RTCPeerConnection::createDataChannel):
594         (WebCore::RTCPeerConnection::close):
595         (WebCore::RTCPeerConnection::stop):
596         (WebCore::RTCPeerConnection::setSignalingState):
597         (WebCore::RTCPeerConnection::updateIceGatheringState):
598         (WebCore::RTCPeerConnection::updateIceConnectionState):
599         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
600         (WebCore::RTCPeerConnection::fireEvent):
601         (WebCore::validateIceServerURL): Deleted.
602         (WebCore::processIceServer): Deleted.
603         (WebCore::RTCPeerConnection::parseConfiguration): Deleted.
604         (WebCore::RTCPeerConnection::~RTCPeerConnection): Deleted.
605         (WebCore::RTCPeerConnection::createOffer): Deleted.
606         (WebCore::RTCPeerConnection::createAnswer): Deleted.
607         (WebCore::RTCPeerConnection::checkStateForLocalDescription): Deleted.
608         (WebCore::RTCPeerConnection::checkStateForRemoteDescription): Deleted.
609         (WebCore::RTCPeerConnection::setLocalDescription): Deleted.
610         (WebCore::RTCPeerConnection::setRemoteDescription): Deleted.
611         (WebCore::RTCPeerConnection::updateIce): Deleted.
612         (WebCore::RTCPeerConnection::addIceCandidate): Deleted.
613         (WebCore::RTCPeerConnection::addStream): Deleted.
614         (WebCore::RTCPeerConnection::removeStream): Deleted.
615         (WebCore::RTCPeerConnection::getLocalStreams): Deleted.
616         (WebCore::RTCPeerConnection::getRemoteStreams): Deleted.
617         (WebCore::RTCPeerConnection::getStreamById): Deleted.
618         (WebCore::RTCPeerConnection::getStats): Deleted.
619         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId): Deleted.
620         (WebCore::RTCPeerConnection::createDTMFSender): Deleted.
621         (WebCore::RTCPeerConnection::negotiationNeeded): Deleted.
622         (WebCore::RTCPeerConnection::didGenerateIceCandidate): Deleted.
623         (WebCore::RTCPeerConnection::didChangeSignalingState): Deleted.
624         (WebCore::RTCPeerConnection::didChangeIceGatheringState): Deleted.
625         (WebCore::RTCPeerConnection::didChangeIceConnectionState): Deleted.
626         (WebCore::RTCPeerConnection::didAddRemoteStream): Deleted.
627         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
628         (WebCore::RTCPeerConnection::didAddRemoteDataChannel): Deleted.
629         (WebCore::RTCPeerConnection::didAddOrRemoveTrack): Deleted.
630         (WebCore::RTCPeerConnection::changeSignalingState): Deleted.
631         (WebCore::RTCPeerConnection::changeIceGatheringState): Deleted.
632         (WebCore::RTCPeerConnection::changeIceConnectionState): Deleted.
633         (WebCore::RTCPeerConnection::scheduleDispatchEvent): Deleted.
634         (WebCore::RTCPeerConnection::scheduledEventTimerFired): Deleted.
635         * Modules/mediastream/RTCPeerConnection.h:
636         * Modules/mediastream/RTCPeerConnection.idl:
637         * Modules/mediastream/RTCPeerConnection.js: Added.
638         (createOffer):
639         (createAnswer):
640         (setLocalDescription):
641         (setRemoteDescription):
642         (addIceCandidate):
643         (getStats):
644         * Modules/mediastream/RTCPeerConnectionErrorCallback.h:
645         (WebCore::RTCPeerConnectionErrorCallback::~RTCPeerConnectionErrorCallback): Deleted.
646         * Modules/mediastream/RTCPeerConnectionInternals.js: Added.
647         (runNext):
648         (enqueueOperation):
649         (setLocalOrRemoteDescription):
650         (extractCallbackArg):
651         * Modules/mediastream/RTCRtpReceiver.cpp: Added.
652         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
653         * Modules/mediastream/RTCRtpReceiver.h: Added.
654         (WebCore::RTCRtpReceiver::create):
655         * Modules/mediastream/RTCRtpReceiver.idl: Added.
656         * Modules/mediastream/RTCRtpSender.cpp: Added.
657         (WebCore::RTCRtpSender::RTCRtpSender):
658         * Modules/mediastream/RTCRtpSender.h: Added.
659         (WebCore::RTCRtpSender::create):
660         (WebCore::RTCRtpSender::mediaStreamId):
661         * Modules/mediastream/RTCRtpSender.idl: Added.
662         * Modules/mediastream/RTCRtpSenderReceiverBase.h: Added.
663         (WebCore::RTCRtpSenderReceiverBase::~RTCRtpSenderReceiverBase):
664         (WebCore::RTCRtpSenderReceiverBase::track):
665         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
666         * Modules/mediastream/RTCSessionDescription.cpp:
667         (WebCore::RTCSessionDescription::create):
668         (WebCore::RTCSessionDescription::RTCSessionDescription):
669         (WebCore::RTCSessionDescription::setType):
670         (WebCore::RTCSessionDescription::~RTCSessionDescription): Deleted.
671         (WebCore::RTCSessionDescription::type): Deleted.
672         (WebCore::RTCSessionDescription::sdp): Deleted.
673         (WebCore::RTCSessionDescription::setSdp): Deleted.
674         (WebCore::RTCSessionDescription::descriptor): Deleted.
675         * Modules/mediastream/RTCSessionDescription.h:
676         (WebCore::RTCSessionDescription::~RTCSessionDescription):
677         (WebCore::RTCSessionDescription::type):
678         (WebCore::RTCSessionDescription::sdp):
679         (WebCore::RTCSessionDescription::setSdp):
680         * Modules/mediastream/RTCSessionDescriptionCallback.h:
681         (WebCore::RTCSessionDescriptionCallback::~RTCSessionDescriptionCallback): Deleted.
682         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: Removed.
683         (WebCore::RTCSessionDescriptionRequestImpl::create): Deleted.
684         (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): Deleted.
685         (WebCore::RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl): Deleted.
686         (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): Deleted.
687         (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): Deleted.
688         (WebCore::RTCSessionDescriptionRequestImpl::stop): Deleted.
689         (WebCore::RTCSessionDescriptionRequestImpl::activeDOMObjectName): Deleted.
690         (WebCore::RTCSessionDescriptionRequestImpl::canSuspendForPageCache): Deleted.
691         (WebCore::RTCSessionDescriptionRequestImpl::clear): Deleted.
692         * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: Removed.
693         * Modules/mediastream/RTCStatsCallback.h: Removed.
694         (WebCore::RTCStatsCallback::~RTCStatsCallback): Deleted.
695         * Modules/mediastream/RTCStatsCallback.idl: Removed.
696         * Modules/mediastream/RTCStatsRequestImpl.cpp: Removed.
697         (WebCore::RTCStatsRequestImpl::create): Deleted.
698         (WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl): Deleted.
699         (WebCore::RTCStatsRequestImpl::~RTCStatsRequestImpl): Deleted.
700         (WebCore::RTCStatsRequestImpl::createResponse): Deleted.
701         (WebCore::RTCStatsRequestImpl::hasSelector): Deleted.
702         (WebCore::RTCStatsRequestImpl::track): Deleted.
703         (WebCore::RTCStatsRequestImpl::requestSucceeded): Deleted.
704         (WebCore::RTCStatsRequestImpl::requestFailed): Deleted.
705         (WebCore::RTCStatsRequestImpl::stop): Deleted.
706         (WebCore::RTCStatsRequestImpl::activeDOMObjectName): Deleted.
707         (WebCore::RTCStatsRequestImpl::canSuspendForPageCache): Deleted.
708         (WebCore::RTCStatsRequestImpl::clear): Deleted.
709         * Modules/mediastream/RTCStatsRequestImpl.h: Removed.
710         * Modules/mediastream/RTCTrackEvent.cpp: Added.
711         (WebCore::RTCTrackEventInit::RTCTrackEventInit):
712         (WebCore::RTCTrackEvent::create):
713         (WebCore::RTCTrackEvent::RTCTrackEvent):
714         * Modules/mediastream/RTCTrackEvent.h: Added.
715         (WebCore::RTCTrackEvent::receiver):
716         (WebCore::RTCTrackEvent::track):
717         (WebCore::RTCTrackEvent::eventInterface):
718         * Modules/mediastream/RTCTrackEvent.idl: Added.
719         * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed.
720         (WebCore::RTCVoidRequestImpl::create): Deleted.
721         (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl): Deleted.
722         (WebCore::RTCVoidRequestImpl::~RTCVoidRequestImpl): Deleted.
723         (WebCore::RTCVoidRequestImpl::requestSucceeded): Deleted.
724         (WebCore::RTCVoidRequestImpl::requestFailed): Deleted.
725         (WebCore::RTCVoidRequestImpl::stop): Deleted.
726         (WebCore::RTCVoidRequestImpl::activeDOMObjectName): Deleted.
727         (WebCore::RTCVoidRequestImpl::canSuspendForPageCache): Deleted.
728         (WebCore::RTCVoidRequestImpl::clear): Deleted.
729         * WebCore.xcodeproj/project.pbxproj:
730         * bindings/js/JSDictionary.cpp:
731         (WebCore::JSDictionary::convertValue):
732         * bindings/js/JSDictionary.h:
733         * bindings/js/WebCoreBuiltinNames.h:
734         * bindings/js/WebCoreJSBuiltinInternals.h:
735         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
736         (WebCore::JSBuiltinInternalFunctions::rTCPeerConnectionInternals):
737         (WebCore::JSBuiltinInternalFunctions::visit):
738         (WebCore::JSBuiltinInternalFunctions::init):
739         * bindings/js/WebCoreJSBuiltins.cpp:
740         * bindings/js/WebCoreJSBuiltins.h:
741         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
742         (WebCore::JSBuiltinFunctions::rTCPeerConnectionBuiltins):
743         (WebCore::JSBuiltinFunctions::rTCPeerConnectionInternalsBuiltins):
744         * dom/EventNames.in:
745
746 2015-11-15  David Kilzer  <ddkilzer@apple.com>
747
748         REGRESSION (r192404): Fix tvOS and watchOS builds
749
750         * platform/spi/cocoa/QuartzCoreSPI.h: Add more version checks to
751         fix all the builds.
752
753 2015-11-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
754
755         [EFL][GTK] Remove use of String::format() in versionForUAString()
756         https://bugs.webkit.org/show_bug.cgi?id=151250
757
758         Reviewed by Darin Adler.
759
760         As String::format() will be deprecated due to the security problem, reimplement
761         versionForUAString() using a macro.
762
763         * platform/efl/UserAgentEfl.cpp:
764         (WebCore::versionForUAString):
765         * platform/gtk/UserAgentGtk.cpp:
766         (WebCore::platformVersionForUAString):
767         (WebCore::versionForUAString):
768
769 2015-11-14  Antti Koivisto  <antti@apple.com>
770
771         Regression(r188820): Downloads of data URLs is broken
772         https://bugs.webkit.org/show_bug.cgi?id=150900
773         rdar://problem/23399223
774
775         Reviewed by Darin Adler.
776
777         No test, the current test infrastructure only allows testing policy decisions, not the actual download.
778
779         * loader/DocumentLoader.cpp:
780         (WebCore::DocumentLoader::continueAfterContentPolicy):
781
782         Use normal download path for data URLs instead of trying to convert the main resource load.
783         Since we decode data URLs locally there is no associated resource load on WebKit side.
784
785 2015-11-14  Nan Wang  <n_wang@apple.com>
786
787         AX: add a new trait for elements in fieldset on iOS
788         https://bugs.webkit.org/show_bug.cgi?id=151281
789
790         Reviewed by Chris Fleizach.
791
792         Added a new trait for elements in the fieldset, so VoiceOver can speak the legend
793         information for those elements.
794
795         Test: accessibility/ios-simulator/fieldset-traits.html
796
797         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
798         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
799         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
800         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
801         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
802
803 2015-11-13  Commit Queue  <commit-queue@webkit.org>
804
805         Unreviewed, rolling out r192445, r192451, and r192452.
806         https://bugs.webkit.org/show_bug.cgi?id=151291
807
808         Broke Mavericks build (and thus EWS) (Requested by ap on
809         #webkit).
810
811         Reverted changesets:
812
813         "Add identifier strings for a bunch of context menu items"
814         https://bugs.webkit.org/show_bug.cgi?id=151272
815         http://trac.webkit.org/changeset/192445
816
817         "Try to fix the 32-bit build"
818         http://trac.webkit.org/changeset/192451
819
820         "Try to fix the 32-bit build"
821         http://trac.webkit.org/changeset/192452
822
823 2015-11-13  Anders Carlsson  <andersca@apple.com>
824
825         Add identifier strings for a bunch of context menu items
826         https://bugs.webkit.org/show_bug.cgi?id=151272
827
828         Reviewed by Dan Bernstein.
829
830         Have NSMenuItem conform to NSUserInterfaceItemIdentification.
831
832         * platform/spi/mac/NSMenuSPI.h:
833
834 2015-11-13  Zalan Bujtas  <zalan@apple.com>
835
836         Always render at least a device pixel line when border/outline width > 0.
837         https://bugs.webkit.org/show_bug.cgi?id=151269
838
839         This matches Firefox behaviour.
840
841         Reviewed by Simon Fraser.
842
843         Existing test is modified to reflect the new behaviour.
844
845         * css/StyleBuilderConverter.h:
846         (WebCore::StyleBuilderConverter::convertLineWidth):
847         * rendering/BorderEdge.cpp:
848         (WebCore::BorderEdge::BorderEdge): Deleted.
849         * rendering/BorderEdge.h:
850
851 2015-11-13  Per Arne Vollan  <peavo@outlook.com>
852
853         [WinCairo][MediaFoundation] Video rendered at wrong position.
854         https://bugs.webkit.org/show_bug.cgi?id=151271
855
856         Reviewed by Alex Christensen.
857
858         The source rectangle used when blitting a frame to the graphics context
859         should have offset (0, 0).
860
861         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
862         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
863
864 2015-11-13  Joseph Pecoraro  <pecoraro@apple.com>
865
866         Web Inspector: Provide a way to override the WKWebView remote inspector name
867         https://bugs.webkit.org/show_bug.cgi?id=151075
868
869         Reviewed by Tim Horton.
870
871         * page/Page.cpp:
872         (WebCore::Page::remoteInspectionNameOverride):
873         (WebCore::Page::setRemoteInspectionNameOverride):
874         * page/Page.h:
875         * page/PageDebuggable.cpp:
876         (WebCore::PageDebuggable::name):
877         (WebCore::PageDebuggable::setNameOverride):
878         * page/PageDebuggable.h:
879
880 2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
881
882         Element::focus() should acquire the ownership of Frame.
883         https://bugs.webkit.org/show_bug.cgi?id=150204
884         <rdar://problem/23136794>
885
886         Reviewed by Brent Fulgham.
887
888         The FrameSelection::setSelection method sometimes releases the last reference to a frame.
889         When this happens, the Element::updateFocusAppearance would attempt to use dereferenced memory.
890         Instead, we should ensure that the Frame lifetime is guaranteed to extend through the duration
891         of the method call.
892
893         Test: editing/selection/focus-iframe-removal-crash.html
894
895         * dom/Element.cpp:
896         (WebCore::Element::updateFocusAppearance):
897
898 2015-11-13  Sergio Villar Senin  <svillar@igalia.com>
899
900         [css-grid] Remove unused GridResolvedPosition constructor
901         https://bugs.webkit.org/show_bug.cgi?id=151133
902
903         Reviewed by Mario Sanchez Prada.
904
905         No new tests required, just deleting dead code.
906
907         * rendering/style/GridResolvedPosition.cpp:
908         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
909         * rendering/style/GridResolvedPosition.h:
910
911 2015-11-13  Sergio Villar Senin  <svillar@igalia.com>
912
913         ASSERTION FAILED: m_isEngaged in WTF::Optional::value
914         https://bugs.webkit.org/show_bug.cgi?id=151094
915
916         Reviewed by Darin Adler.
917
918         That ASSERT was hit because the precondition was incorrectly
919         met, i.e., we're considering that the main axis length was
920         definite when it was actually not. The problem is that to
921         determine whether it was indefinite or not we're using
922         RenderBox::hasDefiniteLogicalHeight() which did not perfectly
923         match RenderBox::computePercentageLogicalHeight() for the case
924         of RenderTables. So computePercentageLogicalHeight() was
925         returning Nullopt (i.e. indefinite) while
926         hasDefiniteLogicalHeight() was returning true (so definite).
927
928         Some checks were refactored in a helper function to solve the
929         inconsistency so that both functions behave the same way even
930         in this particular situation.
931
932         Test: css3/flexbox/inline-flex-percentage-height-in-table-crash.html
933
934         * rendering/RenderBox.cpp:
935         (WebCore::tableCellShouldHaveZeroInitialSize):
936         (WebCore::RenderBox::computePercentageLogicalHeight):
937         (WebCore::percentageLogicalHeightIsResolvable):
938         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
939         * rendering/RenderBox.h:
940
941 2015-11-13  Csaba Osztrogonác  <ossy@webkit.org>
942
943         Unreviewed, really fix the Mac CMake build after r192376.
944
945         * PlatformMac.cmake:
946
947 2015-11-13  Csaba Osztrogonác  <ossy@webkit.org>
948
949         Unreviewed, fix the Mac CMake build after r192376.
950
951         * PlatformMac.cmake:
952
953 2015-11-12  Tim Horton  <timothy_horton@apple.com>
954
955         Follow up to the previous change
956
957         * platform/spi/cocoa/QuartzCoreSPI.h:
958         Somehow this escaped.
959
960 2015-11-12  Tim Horton  <timothy_horton@apple.com>
961
962         Try to fix the Watch/TV build
963
964         * platform/spi/cocoa/QuartzCoreSPI.h:
965         Be more accurate about where we need these.
966
967 2015-11-12  Brady Eidson  <beidson@apple.com>
968
969         Modern IDB: Pipe through cursor functions from client to server.
970         https://bugs.webkit.org/show_bug.cgi?id=151197
971
972         Reviewed by Alex Christensen.
973
974         Tests: storage/indexeddb/modern/cursor-1.html
975                storage/indexeddb/modern/opencursor-failures.html
976
977         This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
978         appropriate messages through from client to server.
979         
980         All operations currently end in errors. Bug 151196 will fix that by making cursors functional.
981         
982         * CMakeLists.txt:
983         * WebCore.xcodeproj/project.pbxproj:
984
985         * Modules/indexeddb/IDBCursor.h:
986         (WebCore::IDBCursor::isKeyCursor): Deleted.
987         * Modules/indexeddb/IDBCursorWithValue.h:
988
989         * Modules/indexeddb/IDBGetResult.h:
990
991         * Modules/indexeddb/IDBKeyData.h:
992         (WebCore::IDBKeyData::string):
993         (WebCore::IDBKeyData::date):
994         (WebCore::IDBKeyData::number):
995         (WebCore::IDBKeyData::array):
996
997         * Modules/indexeddb/IndexedDB.h:
998
999         * Modules/indexeddb/client/IDBAnyImpl.cpp:
1000         (WebCore::IDBClient::IDBAny::IDBAny):
1001         (WebCore::IDBClient::IDBAny::idbCursor):
1002         (WebCore::IDBClient::IDBAny::idbCursorWithValue):
1003         (WebCore::IDBClient::IDBAny::idbIndex):
1004         (WebCore::IDBClient::IDBAny::idbObjectStore):
1005         (WebCore::IDBClient::IDBAny::modernIDBCursor):
1006         * Modules/indexeddb/client/IDBAnyImpl.h:
1007         (WebCore::IDBClient::IDBAny::create):
1008
1009         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1010         (WebCore::IDBClient::IDBConnectionToServer::openCursor):
1011         (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
1012         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
1013         (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
1014         * Modules/indexeddb/client/IDBConnectionToServer.h:
1015         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
1016
1017         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1018         (WebCore::IDBClient::IDBCursor::create):
1019         (WebCore::IDBClient::IDBCursor::IDBCursor):
1020         (WebCore::IDBClient::IDBCursor::sourcesDeleted):
1021         (WebCore::IDBClient::IDBCursor::effectiveObjectStore):
1022         (WebCore::IDBClient::IDBCursor::transaction):
1023         (WebCore::IDBClient::IDBCursor::direction):
1024         (WebCore::IDBClient::IDBCursor::key):
1025         (WebCore::IDBClient::IDBCursor::primaryKey):
1026         (WebCore::IDBClient::IDBCursor::value):
1027         (WebCore::IDBClient::IDBCursor::source):
1028         (WebCore::IDBClient::IDBCursor::update):
1029         (WebCore::IDBClient::IDBCursor::advance):
1030         (WebCore::IDBClient::IDBCursor::continueFunction):
1031         (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
1032         (WebCore::IDBClient::IDBCursor::deleteFunction):
1033         (WebCore::IDBClient::IDBCursor::setGetResult):
1034         * Modules/indexeddb/client/IDBCursorImpl.h:
1035         (WebCore::IDBClient::IDBCursor::info):
1036         (WebCore::IDBClient::IDBCursor::setRequest):
1037         (WebCore::IDBClient::IDBCursor::clearRequest):
1038         (WebCore::IDBClient::IDBCursor::request):
1039
1040         * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
1041         (WebCore::IDBClient::IDBCursorWithValue::create):
1042         (WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
1043         (WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
1044         * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
1045
1046         * Modules/indexeddb/client/IDBIndexImpl.cpp:
1047         (WebCore::IDBClient::IDBIndex::openCursor):
1048         (WebCore::IDBClient::IDBIndex::openKeyCursor):
1049         * Modules/indexeddb/client/IDBIndexImpl.h:
1050         (WebCore::IDBClient::IDBIndex::modernObjectStore):
1051         (WebCore::IDBClient::IDBIndex::isDeleted):
1052
1053         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1054         (WebCore::IDBClient::IDBObjectStore::openCursor):
1055         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
1056         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1057
1058         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1059         (WebCore::IDBClient::IDBRequest::create):
1060         (WebCore::IDBClient::IDBRequest::IDBRequest):
1061         (WebCore::IDBClient::IDBRequest::~IDBRequest):
1062         (WebCore::IDBClient::IDBRequest::source):
1063         (WebCore::IDBClient::IDBRequest::resultCursor):
1064         (WebCore::IDBClient::IDBRequest::willIterateCursor):
1065         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
1066         (WebCore::IDBClient::IDBRequest::requestCompleted):
1067         * Modules/indexeddb/client/IDBRequestImpl.h:
1068         (WebCore::IDBClient::IDBRequest::modernResult):
1069
1070         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1071         (WebCore::IDBClient::IDBTransaction::requestOpenCursor):
1072         (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
1073         (WebCore::IDBClient::IDBTransaction::openCursorOnServer):
1074         (WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
1075         (WebCore::IDBClient::IDBTransaction::iterateCursor):
1076         (WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
1077         (WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
1078         * Modules/indexeddb/client/IDBTransactionImpl.h:
1079
1080         * Modules/indexeddb/client/TransactionOperation.h:
1081         (WebCore::IDBClient::createTransactionOperation):
1082
1083         * Modules/indexeddb/legacy/LegacyCursor.cpp:
1084         (WebCore::LegacyCursor::source):
1085         * Modules/indexeddb/legacy/LegacyCursor.h:
1086         (WebCore::LegacyCursor::continueFunction): Deleted.
1087         (WebCore::LegacyCursor::isKeyCursor): Deleted.
1088         * Modules/indexeddb/legacy/LegacyCursorWithValue.h:
1089
1090         * Modules/indexeddb/server/IDBBackingStore.h:
1091
1092         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1093         (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
1094         (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
1095         * Modules/indexeddb/server/IDBConnectionToClient.h:
1096         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1097
1098         * Modules/indexeddb/server/IDBServer.cpp:
1099         (WebCore::IDBServer::IDBServer::openCursor):
1100         (WebCore::IDBServer::IDBServer::iterateCursor):
1101         * Modules/indexeddb/server/IDBServer.h:
1102
1103         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1104         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
1105         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
1106         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1107
1108         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1109         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
1110         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
1111         (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
1112         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
1113         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
1114         (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
1115         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1116
1117         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1118         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
1119         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
1120         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
1121         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1122
1123         * Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
1124         (WebCore::IDBCursorInfo::objectStoreCursor):
1125         (WebCore::IDBCursorInfo::indexCursor):
1126         (WebCore::IDBCursorInfo::IDBCursorInfo):
1127         (WebCore::IDBCursorInfo::isDirectionForward):
1128         (WebCore::IDBCursorInfo::isolatedCopy):
1129         * Modules/indexeddb/shared/IDBCursorInfo.h: Added.
1130         (WebCore::IDBCursorInfo::identifier):
1131         (WebCore::IDBCursorInfo::sourceIdentifier):
1132         (WebCore::IDBCursorInfo::cursorSource):
1133         (WebCore::IDBCursorInfo::cursorDirection):
1134         (WebCore::IDBCursorInfo::cursorType):
1135
1136         * Modules/indexeddb/shared/IDBResultData.cpp:
1137         (WebCore::IDBResultData::openCursorSuccess):
1138         (WebCore::IDBResultData::iterateCursorSuccess):
1139         * Modules/indexeddb/shared/IDBResultData.h:
1140
1141         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1142         (WebCore::InProcessIDBServer::didOpenCursor):
1143         (WebCore::InProcessIDBServer::didIterateCursor):
1144         (WebCore::InProcessIDBServer::openCursor):
1145         (WebCore::InProcessIDBServer::iterateCursor):
1146         * Modules/indexeddb/shared/InProcessIDBServer.h:
1147
1148         * bindings/js/IDBBindingUtilities.cpp:
1149         (WebCore::idbKeyDataToJSValue):
1150         * bindings/js/IDBBindingUtilities.h:
1151
1152         * platform/CrossThreadCopier.cpp:
1153         (WebCore::IDBCursorInfo>::copy):
1154         * platform/CrossThreadCopier.h:
1155
1156 2015-11-12  Anders Carlsson  <andersca@apple.com>
1157
1158         Delete PlatformMenuDescription.h
1159         https://bugs.webkit.org/show_bug.cgi?id=151229
1160
1161         Reviewed by Beth Dakin.
1162
1163         * WebCore.vcxproj/WebCore.vcxproj:
1164         * WebCore.vcxproj/WebCore.vcxproj.filters:
1165         * WebCore.xcodeproj/project.pbxproj:
1166         * page/ContextMenuClient.h:
1167         * platform/ContextMenu.h:
1168         * platform/ContextMenuItem.h:
1169         * platform/PlatformMenuDescription.h: Removed.
1170
1171 2015-11-12  Anders Carlsson  <andersca@apple.com>
1172
1173         ContextMenuAction and WebMenuItemTag shouldn't have to be in sync
1174         https://bugs.webkit.org/show_bug.cgi?id=151226
1175
1176         Reviewed by Tim Horton.
1177
1178         * page/ContextMenuController.cpp:
1179         * platform/ContextMenuItem.h:
1180         Remove now unneeded comments. Also, remove ContextMenuItemTagOpenLinkInThisWindow since it wasn't used by any of our remaining ports.
1181
1182 2015-11-12  Zalan Bujtas  <zalan@apple.com>
1183
1184         Ignore visited background color when deciding if the input renderer needs to be painted natively.
1185         https://bugs.webkit.org/show_bug.cgi?id=151211
1186         rdar://problem/21449823
1187
1188         Reviewed by Antti Koivisto.
1189
1190         Test: fast/css/pseudo-visited-background-color-on-input.html
1191
1192         * rendering/RenderTheme.cpp:
1193         (WebCore::RenderTheme::isControlStyled):
1194         * rendering/style/RenderStyle.h:
1195
1196 2015-11-12  David Hyatt  <hyatt@apple.com>
1197
1198         Tatechuyoko shrink-to-fit breaks after changing color, background-color or text-decoration
1199         https://bugs.webkit.org/show_bug.cgi?id=151218
1200         <rdar://problem/23521702>
1201
1202         Reviewed by Myles Maxfield.
1203
1204         Added fast/text/text-combine-shrink-on-color-change.html
1205
1206         * rendering/RenderCombineText.cpp:
1207         (WebCore::RenderCombineText::styleDidChange):
1208
1209 2015-11-12  Anders Carlsson  <andersca@apple.com>
1210
1211         Use ContextMenuItemTagNoAction instead of ContextMenuItemCustomTagNoAction
1212         https://bugs.webkit.org/show_bug.cgi?id=151222
1213
1214         Reviewed by Joseph Pecoraro.
1215
1216         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1217         (WebCore::populateContextMenuItems):
1218         * page/ContextMenuController.cpp:
1219         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Deleted.
1220         * platform/ContextMenuItem.h:
1221
1222 2015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
1223
1224         [Cocoa] Font fallback is not language-sensitive
1225         https://bugs.webkit.org/show_bug.cgi?id=147390
1226
1227         Reviewed by Dean Jackson.
1228
1229         Test: fast/text/fallback-language-han-2.html
1230
1231         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1232         (WebCore::FontCache::systemFallbackForCharacters):
1233
1234 2015-11-12  Anders Carlsson  <andersca@apple.com>
1235
1236         ContextMenuController::contextMenuItemSelected only needs the action and title, not the full item
1237         https://bugs.webkit.org/show_bug.cgi?id=151217
1238
1239         Reviewed by Joseph Pecoraro.
1240
1241         * inspector/InspectorFrontendHost.cpp:
1242         * page/ContextMenuController.cpp:
1243         (WebCore::ContextMenuController::contextMenuItemSelected):
1244         * page/ContextMenuController.h:
1245         * page/ContextMenuProvider.h:
1246
1247 2015-11-12  Anders Carlsson  <andersca@apple.com>
1248
1249         Remove an unused function
1250         https://bugs.webkit.org/show_bug.cgi?id=151215
1251
1252         Reviewed by Joseph Pecoraro.
1253
1254         * loader/EmptyClients.h:
1255         * page/ContextMenuClient.h:
1256         * page/ContextMenuController.cpp:
1257         (WebCore::ContextMenuController::contextMenuItemSelected): Deleted.
1258
1259 2015-11-11  Anders Carlsson  <andersca@apple.com>
1260
1261         Enable cross-platform context menus by default
1262         https://bugs.webkit.org/show_bug.cgi?id=151173
1263
1264         Reviewed by Tim Horton.
1265
1266         * WebCore.xcodeproj/project.pbxproj:
1267         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1268         (WebCore::JSInspectorFrontendHost::showContextMenu):
1269         * page/ContextMenuController.cpp:
1270         (WebCore::ContextMenuController::addInspectElementItem): Deleted.
1271         * platform/ContextMenu.cpp:
1272         * platform/ContextMenu.h:
1273         * platform/ContextMenuItem.cpp:
1274         * platform/ContextMenuItem.h:
1275         (WebCore::ContextMenuItem::isNull): Deleted.
1276         * platform/mac/ContextMenuItemMac.mm: Removed.
1277         (WebCore::menuToArray): Deleted.
1278         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
1279         (WebCore::createPlatformMenuItemDescription): Deleted.
1280         (WebCore::ContextMenuItem::~ContextMenuItem): Deleted.
1281         (WebCore::ContextMenuItem::platformDescription): Deleted.
1282         (WebCore::ContextMenuItem::type): Deleted.
1283         (WebCore::ContextMenuItem::action): Deleted.
1284         (WebCore::ContextMenuItem::title): Deleted.
1285         (WebCore::ContextMenuItem::platformSubMenu): Deleted.
1286         (WebCore::ContextMenuItem::setType): Deleted.
1287         (WebCore::ContextMenuItem::setAction): Deleted.
1288         (WebCore::ContextMenuItem::setTitle): Deleted.
1289         (WebCore::ContextMenuItem::setSubMenu): Deleted.
1290         (WebCore::ContextMenuItem::setChecked): Deleted.
1291         (WebCore::ContextMenuItem::setEnabled): Deleted.
1292         (WebCore::ContextMenuItem::enabled): Deleted.
1293         (WebCore::ContextMenuItem::checked): Deleted.
1294         * platform/mac/ContextMenuMac.mm: Removed.
1295         (WebCore::ContextMenu::ContextMenu): Deleted.
1296         (WebCore::ContextMenu::~ContextMenu): Deleted.
1297         (WebCore::ContextMenu::appendItem): Deleted.
1298         (WebCore::ContextMenu::insertItem): Deleted.
1299         (WebCore::ContextMenu::itemCount): Deleted.
1300         (WebCore::ContextMenu::setPlatformDescription): Deleted.
1301         (WebCore::ContextMenu::platformDescription): Deleted.
1302         (WebCore::ContextMenu::releasePlatformDescription): Deleted.
1303         (WebCore::contextMenuItemVector): Deleted.
1304         (WebCore::platformMenuDescription): Deleted.
1305
1306 2015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
1307
1308         [Cocoa] Font fallback is not language-sensitive
1309         https://bugs.webkit.org/show_bug.cgi?id=147390
1310
1311         Reviewed by Dean Jackson.
1312
1313         This re-applies r190754 in a somewhat more performant way.
1314
1315         Test: fast/text/fallback-language-han-2.html
1316
1317         * platform/graphics/Font.cpp:
1318         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
1319         (WebCore::CharacterFallbackMapKey::operator==):
1320         (WebCore::CharacterFallbackMapKeyHash::hash):
1321         (WebCore::Font::systemFallbackFontForCharacter):
1322         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1323         (WebCore::FontCache::systemFallbackForCharacters):
1324
1325 2015-11-11  Jon Honeycutt  <jhoneycutt@apple.com>
1326
1327         popstate event should be dispatched asynchronously
1328         https://bugs.webkit.org/show_bug.cgi?id=36202
1329         <rdar://problem/7761279>
1330
1331         Based on an original patch by Mihai Parparita <mihaip@chromium.org>.
1332
1333         Reviewed by Brent Fulgham.
1334
1335         Tests: fast/loader/remove-iframe-during-history-navigation-different.html
1336                fast/loader/remove-iframe-during-history-navigation-same.html
1337                fast/loader/stateobjects/popstate-is-asynchronous.html
1338
1339         * dom/Document.cpp:
1340         (WebCore::Document::enqueuePopstateEvent):
1341         Use enqueueWindowEvent().
1342
1343 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
1344
1345         Fix build failure due to missing NeverDestroyed.h include after r192169
1346         https://bugs.webkit.org/show_bug.cgi?id=151186
1347
1348         Reviewed by Darin Adler.
1349
1350         * rendering/RenderCombineText.cpp:
1351
1352 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
1353
1354         Fix build failure due to missing forward declaration of FontVariantSettings after r191968
1355         https://bugs.webkit.org/show_bug.cgi?id=151185
1356
1357         Reviewed by Myles C. Maxfield.
1358
1359         * css/CSSFontFaceSource.h:
1360
1361 2015-11-12  Eric Carlson  <eric.carlson@apple.com>
1362
1363         [MediaStream] Reflect media stream tracks as HTMLMediaElement tracks
1364         https://bugs.webkit.org/show_bug.cgi?id=151145
1365
1366         Reviewed by Jer Noble.
1367
1368         Test: fast/mediastream/MediaStream-video-element.html
1369
1370         * WebCore.xcodeproj/project.pbxproj: Add new header files.
1371
1372         * html/track/AudioTrack.h: Add comments to clean things up slightly.
1373         * html/track/VideoTrack.h: Ditto.
1374
1375         Create a AudioTrackPrivateMediaStream or VideoTrackPrivateMediaStream for each track in
1376         the MediaStream.
1377         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1378         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1379         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Call updateTracks.
1380         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didAddTrack): Ditto.
1381         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didRemoveTrack): Ditto.
1382         (WebCore::updateTracksOfType): New, template function to update audio or video tracks.
1383         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): New.
1384
1385         * platform/mediastream/AudioTrackPrivateMediaStream.h: Added.
1386
1387         * platform/mediastream/MediaStreamPrivate.cpp:
1388         (WebCore::MediaStreamPrivate::currentFrameImage): Fix a typo, early return if the track is
1389           not active OR there is no active video track.
1390         * platform/mediastream/MediaStreamPrivate.h:
1391         (WebCore::MediaStreamPrivate::activeVideoTrack): Accessor for active video track, if any.
1392
1393         * platform/mediastream/VideoTrackPrivateMediaStream.h: Added.
1394
1395         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1396         (WebCore::AVAudioCaptureSource::updateStates): Set current states.
1397
1398         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1399         (WebCore::AVMediaCaptureSource::states): Set source ID.
1400         (WebCore::AVMediaCaptureSource::capabilities): Set source ID directly.
1401
1402         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1403         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1404         (WebCore::AVVideoCaptureSource::updateStates): Set states here instead of in the constructor.
1405
1406         * platform/mock/MockRealtimeMediaSource.cpp:
1407         (WebCore::MockRealtimeMediaSource::capabilities): Set source ID directly.
1408
1409         * platform/mock/MockRealtimeVideoSource.cpp:
1410         (WebCore::MockRealtimeVideoSource::updateStates): Set source type.
1411
1412 2015-11-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1413
1414         XHR abort() event firing does not match spec
1415         https://bugs.webkit.org/show_bug.cgi?id=98404
1416
1417         Reviewed by Darin Adler.
1418
1419         Introducing explicit sendFlag as in the specification.
1420         Previously, sendFlag was computed using !!m_loader.
1421         But this does not work well for loadstart events since sendFlag should be true but m_loader is still null at that time.
1422
1423         Updated abort event firing test according specification.
1424         For instance, compared to previously, the abort event is not fired in DONE state or if sendFlag is not set.
1425
1426         Covered by rebased tests.
1427
1428         * xml/XMLHttpRequest.cpp:
1429         (WebCore::XMLHttpRequest::callReadyStateChangeListener): Compute whether dispatching the load event before calling XHR readystatechange event callback.
1430         (WebCore::XMLHttpRequest::setWithCredentials): Replacing m_loader by m_sendFlag to align with the spec.
1431         (WebCore::XMLHttpRequest::open): Unsetting m_sendFlag..
1432         (WebCore::XMLHttpRequest::initSend): Replacing m_loader by m_sendFlag to align with the spec.
1433         (WebCore::XMLHttpRequest::createRequest): Setting m_sendFlag.
1434         (WebCore::XMLHttpRequest::abort): Checking m_sendFlag and updating code to follow the specification.
1435         (WebCore::XMLHttpRequest::genericError): Unsetting m_sendFlag.
1436         (WebCore::XMLHttpRequest::setRequestHeader): Replacing m_loader by m_sendFlag to align with the spec.
1437         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
1438         (WebCore::XMLHttpRequest::didReachTimeout): Ditto.
1439         * xml/XMLHttpRequest.h: Added m_sendFlag.
1440
1441 2015-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1442
1443         [GStreamer] Use RunLoop::timer in MediaPlayerPrivateGStreamerBase for GL drawing
1444         https://bugs.webkit.org/show_bug.cgi?id=151099
1445
1446         Reviewed by Philippe Normand.
1447
1448         Instead of the GThreadSafeMainLoopSource.
1449
1450         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1451         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1452         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
1453         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1454         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
1455         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1456
1457 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
1458
1459         Remove ENABLE(SATURATED_LAYOUT_ARITHMETIC) guards
1460         https://bugs.webkit.org/show_bug.cgi?id=150972
1461
1462         Reviewed by Darin Adler.
1463
1464         * Configurations/FeatureDefines.xcconfig:
1465         * platform/LayoutUnit.h:
1466         (WebCore::operator*):
1467         (WebCore::LayoutUnit::LayoutUnit): Deleted.
1468         (WebCore::LayoutUnit::fromFloatCeil): Deleted.
1469         (WebCore::LayoutUnit::fromFloatFloor): Deleted.
1470         (WebCore::LayoutUnit::fromFloatRound): Deleted.
1471         (WebCore::LayoutUnit::ceil): Deleted.
1472         (WebCore::LayoutUnit::round): Deleted.
1473         (WebCore::LayoutUnit::floor): Deleted.
1474         (WebCore::LayoutUnit::setValue): Deleted.
1475         (WebCore::operator/): Deleted.
1476         (WebCore::operator+): Deleted.
1477         (WebCore::operator-): Deleted.
1478         (WebCore::operator+=): Deleted.
1479         (WebCore::operator-=): Deleted.
1480         * rendering/LayoutState.cpp:
1481         (WebCore::LayoutState::LayoutState):
1482         * rendering/LayoutState.h:
1483         (WebCore::LayoutState::LayoutState):
1484         * rendering/RenderView.h:
1485
1486 2015-11-11  Chris Dumez  <cdumez@apple.com>
1487
1488         Stop passing a PassRefPtr to dispatchEvent()
1489         https://bugs.webkit.org/show_bug.cgi?id=151158
1490
1491         Reviewed by Alex Christensen.
1492
1493         Stop passing a PassRefPtr to dispatchEvent() because:
1494         1. PassRefPtr is legacy and should no longer be used
1495         2. We don't actually transfer ownership of the Event to the callee
1496
1497         Pass a C++ reference instead.
1498
1499 2015-11-11  Chris Dumez  <cdumez@apple.com>
1500
1501         Fix leaks in idbKeyFromInspectorObject()
1502         https://bugs.webkit.org/show_bug.cgi?id=151179
1503
1504         Reviewed by Brian Burg.
1505
1506         Fix leaks in idbKeyFromInspectorObject() that were caused by the
1507         NeverDestroyed<> not being marked as static.
1508
1509         * inspector/InspectorIndexedDBAgent.cpp:
1510
1511 2015-11-11  Geoffrey Garen  <ggaren@apple.com>
1512
1513         Rename handle.*Event to dispatch.*Event
1514         https://bugs.webkit.org/show_bug.cgi?id=151168
1515
1516         Reviewed by Chris Dumez.
1517
1518         * dom/Document.cpp:
1519         (WebCore::Document::implicitClose):
1520         * dom/Document.h:
1521         * loader/DocumentLoader.cpp:
1522         (WebCore::DocumentLoader::DocumentLoader):
1523         (WebCore::DocumentLoader::getIconDataForIconURL):
1524         (WebCore::DocumentLoader::dispatchOnloadEvents):
1525         (WebCore::DocumentLoader::handledOnloadEvents): Deleted.
1526         * loader/DocumentLoader.h:
1527         (WebCore::DocumentLoader::isClientRedirect):
1528         (WebCore::DocumentLoader::setIsClientRedirect):
1529         (WebCore::DocumentLoader::wasOnloadDispatched):
1530         (WebCore::DocumentLoader::overrideEncoding):
1531         (WebCore::DocumentLoader::wasOnloadHandled): Deleted.
1532         * loader/EmptyClients.h:
1533         * loader/FrameLoader.cpp:
1534         (WebCore::FrameLoader::submitForm):
1535         (WebCore::FrameLoader::stopLoading):
1536         (WebCore::FrameLoader::userAgent):
1537         (WebCore::FrameLoader::dispatchOnloadEvents):
1538         (WebCore::FrameLoader::frameDetached):
1539         (WebCore::FrameLoader::shouldClose):
1540         (WebCore::FrameLoader::dispatchUnloadEvents):
1541         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
1542         (WebCore::FrameLoader::handledOnloadEvents): Deleted.
1543         (WebCore::FrameLoader::handleUnloadEvents): Deleted.
1544         (WebCore::FrameLoader::handleBeforeUnloadEvent): Deleted.
1545         * loader/FrameLoader.h:
1546         * loader/FrameLoaderClient.h:
1547         * loader/NavigationScheduler.cpp:
1548         (WebCore::NavigationScheduler::mustLockBackForwardList):
1549
1550 2015-11-11  Anders Carlsson  <andersca@apple.com>
1551
1552         Remove more dead code
1553         https://bugs.webkit.org/show_bug.cgi?id=151170
1554
1555         Reviewed by Beth Dakin.
1556
1557         * platform/ContextMenu.cpp:
1558         (WebCore::findItemWithAction): Deleted.
1559         (WebCore::ContextMenu::itemWithAction): Deleted.
1560         * platform/ContextMenu.h:
1561         (WebCore::ContextMenu::itemAtIndex): Deleted.
1562         * platform/ContextMenuItem.h:
1563
1564 2015-11-11  Anders Carlsson  <andersca@apple.com>
1565
1566         De-indent ContextMenu.h and ContextMenuItem.h.
1567
1568         Rubber-stamped by Andreas Kling.
1569
1570         * platform/ContextMenu.h:
1571         * platform/ContextMenuItem.h:
1572
1573 2015-11-11  Anders Carlsson  <andersca@apple.com>
1574
1575         Remove ContextMenuWin.cpp and ContextMenuItemWin.cpp
1576         https://bugs.webkit.org/show_bug.cgi?id=150467
1577
1578         Reviewed by Beth Dakin.
1579
1580         These files are not needed anymore.
1581
1582         * PlatformWin.cmake:
1583         * WebCore.vcxproj/WebCore.vcxproj:
1584         * WebCore.vcxproj/WebCore.vcxproj.filters:
1585         * platform/win/ContextMenuItemWin.cpp: Removed.
1586         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
1587         (WebCore::ContextMenuItem::platformContextMenuItem): Deleted.
1588         * platform/win/ContextMenuWin.cpp: Removed.
1589         (WebCore::ContextMenu::ContextMenu): Deleted.
1590         (WebCore::ContextMenu::getContextMenuItems): Deleted.
1591         (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted.
1592         (WebCore::ContextMenu::platformContextMenu): Deleted.
1593
1594 2015-11-11  Anders Carlsson  <andersca@apple.com>
1595
1596         Get rid of ContextMenuNone.cpp and ContextMenuItemNone.cpp
1597         https://bugs.webkit.org/show_bug.cgi?id=151169
1598
1599         Reviewed by Beth Dakin.
1600
1601         * PlatformEfl.cmake:
1602         * platform/ContextMenuItemNone.cpp: Removed.
1603         (WebCore::ContextMenuItem::platformContextMenuItem): Deleted.
1604         * platform/ContextMenuNone.cpp: Removed.
1605         (WebCore::ContextMenu::ContextMenu): Deleted.
1606         (WebCore::ContextMenu::getContextMenuItems): Deleted.
1607         (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted.
1608         (WebCore::ContextMenu::platformContextMenu): Deleted.
1609
1610 2015-11-11  Anders Carlsson  <andersca@apple.com>
1611
1612         Remove more dead context menu code
1613         https://bugs.webkit.org/show_bug.cgi?id=151163
1614
1615         Reviewed by Tim Horton.
1616
1617         * loader/EmptyClients.h:
1618         * page/ContextMenuClient.h:
1619         * page/ContextMenuController.cpp:
1620         (WebCore::ContextMenuController::populate):
1621         * platform/ContextMenuItem.h:
1622         * platform/mac/ContextMenuItemMac.mm:
1623         (WebCore::ContextMenuItem::shareMenuItem): Deleted.
1624
1625 2015-11-10  Jon Honeycutt  <jhoneycutt@apple.com>
1626
1627         Crash loading Blink layout test fast/parser/strip-script-attrs-on-input.html
1628         https://bugs.webkit.org/show_bug.cgi?id=150201
1629         <rdar://problem/23136478>
1630
1631         Reviewed by Brent Fulgham.
1632
1633         Test: fast/parser/strip-script-attrs-on-input.html
1634
1635         * html/parser/HTMLTreeBuilder.cpp:
1636         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1637         Get the attribute after calling
1638         HTMLConstructionSite::insertSelfClosingHTMLElement(), as this may
1639         mutate the token's attributes.
1640
1641 2015-11-11  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1642
1643         [Streams API] Remove bind usage
1644         https://bugs.webkit.org/show_bug.cgi?id=151104
1645
1646         Reviewed by Youenn Fablet.
1647
1648         Instead of using bind, an inline error function was created.
1649
1650         Internal rework, no tests needed.
1651
1652         * Modules/streams/WritableStream.js:
1653         (error):
1654         (initializeWritableStream):
1655
1656 2015-11-10  Brady Eidson  <beidson@apple.com>
1657
1658         Modern IDB: Make indexes actually index.
1659         https://bugs.webkit.org/show_bug.cgi?id=150939
1660
1661         Reviewed by Alex Christensen.
1662
1663         Tests: storage/indexeddb/modern/index-1.html
1664                storage/indexeddb/modern/index-2.html
1665                storage/indexeddb/modern/index-3.html
1666
1667         * CMakeLists.txt:
1668         * WebCore.xcodeproj/project.pbxproj:
1669
1670         * Modules/indexeddb/IDBKeyData.h:
1671         (WebCore::IDBKeyData::hash): Deleted.
1672
1673         * Modules/indexeddb/IDBKeyRangeData.cpp:
1674         (WebCore::IDBKeyRangeData::isExactlyOneKey):
1675
1676         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1677         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1678
1679         * Modules/indexeddb/server/IndexValueEntry.cpp: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp.
1680         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
1681         (WebCore::IDBServer::IndexValueEntry::~IndexValueEntry):
1682         (WebCore::IDBServer::IndexValueEntry::addKey):
1683         (WebCore::IDBServer::IndexValueEntry::removeKey):
1684         (WebCore::IDBServer::IndexValueEntry::getLowest):
1685         (WebCore::IDBServer::IndexValueEntry::getCount):
1686         * Modules/indexeddb/server/IndexValueEntry.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h.
1687
1688         * Modules/indexeddb/server/IndexValueStore.cpp: Added.
1689         (WebCore::IDBServer::IndexValueStore::IndexValueStore):
1690         (WebCore::IDBServer::IndexValueStore::lowestValueForKey):
1691         (WebCore::IDBServer::IndexValueStore::countForKey):
1692         (WebCore::IDBServer::IndexValueStore::contains):
1693         (WebCore::IDBServer::IndexValueStore::addRecord):
1694         (WebCore::IDBServer::IndexValueStore::removeRecord):
1695         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey):
1696         (WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange):
1697         * Modules/indexeddb/server/IndexValueStore.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h.
1698
1699         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1700         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
1701         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexCleared):
1702         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1703         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1704
1705         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1706         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
1707
1708         * Modules/indexeddb/server/MemoryIndex.cpp:
1709         (WebCore::IDBServer::MemoryIndex::create):
1710         (WebCore::IDBServer::MemoryIndex::MemoryIndex):
1711         (WebCore::IDBServer::MemoryIndex::objectStoreCleared):
1712         (WebCore::IDBServer::MemoryIndex::replaceIndexValueStore):
1713         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange):
1714         (WebCore::IDBServer::MemoryIndex::countForKeyRange):
1715         (WebCore::IDBServer::MemoryIndex::putIndexKey):
1716         (WebCore::IDBServer::MemoryIndex::removeRecord):
1717         (WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey):
1718         (WebCore::IDBServer::MemoryIndex::valueForKeyRange): Deleted.
1719         * Modules/indexeddb/server/MemoryIndex.h:
1720
1721         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1722         (WebCore::IDBServer::MemoryObjectStore::createIndex):
1723         (WebCore::IDBServer::MemoryObjectStore::clear):
1724         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
1725         (WebCore::IDBServer::MemoryObjectStore::addRecord):
1726         (WebCore::IDBServer::indexVM):
1727         (WebCore::IDBServer::indexGlobalExec):
1728         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord):
1729         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
1730         (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
1731         * Modules/indexeddb/server/MemoryObjectStore.h:
1732         (WebCore::IDBServer::MemoryObjectStore::writeTransaction):
1733
1734         * Modules/indexeddb/shared/IndexKey.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp.
1735         (WebCore::IndexKey::IndexKey):
1736         (WebCore::IndexKey::isolatedCopy):
1737         (WebCore::IndexKey::asOneKey):
1738         (WebCore::IndexKey::multiEntry):
1739         * Modules/indexeddb/shared/IndexKey.h: Added.
1740         (WebCore::IndexKey::isNull):
1741
1742         * bindings/js/IDBBindingUtilities.cpp:
1743         (WebCore::idbValueDataToJSValue):
1744         (WebCore::deserializeIDBValueBuffer):
1745         (WebCore::idbKeyDataToScriptValue):
1746         (WebCore::createKeyPathArray):
1747         (WebCore::generateIndexKeyForValue):
1748         * bindings/js/IDBBindingUtilities.h:
1749
1750 2015-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
1751
1752         Move locale information into FontDescription
1753         https://bugs.webkit.org/show_bug.cgi?id=147457
1754
1755         Reviewed by Andreas Kling.
1756
1757         Currently, the "lang" attribute on a node sets locale information in RenderStyle.
1758         Font selection is sensitive to this locale information, and occurs deep within
1759         platform/ code, far away from RenderStyle. Because every RenderStyle owns a
1760         FontDescription, and font selection can consult with FontDescriptions, it makes
1761         sense to move the variable from RenderStyle to FontDescription, and provide
1762         convenience methods on RenderStyle which inspect its FontDescription for locale
1763         information.
1764
1765         This patch is in preparation for correctly obeying locale information when
1766         performing font fallback.
1767
1768         No new tests because there is no behavior change.
1769
1770         * css/CSSPropertyNames.in:
1771         * css/StyleBuilderCustom.h:
1772         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
1773         * platform/graphics/FontCache.h:
1774         * platform/graphics/FontDescription.cpp:
1775         (WebCore::FontDescription::setLocale):
1776         * platform/graphics/FontDescription.h:
1777         (WebCore::FontDescription::locale):
1778         (WebCore::FontDescription::operator==):
1779         (WebCore::FontCascadeDescription::initialLocale):
1780         (WebCore::FontDescription::setScript): Deleted.
1781         * rendering/style/RenderStyle.cpp:
1782         (WebCore::RenderStyle::changeRequiresLayout): Deleted.
1783         * rendering/style/RenderStyle.h:
1784         * rendering/style/StyleRareInheritedData.cpp:
1785         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted.
1786         (WebCore::StyleRareInheritedData::operator==): Deleted.
1787         * rendering/style/StyleRareInheritedData.h:
1788         * style/StyleResolveForDocument.cpp:
1789         (WebCore::Style::resolveForDocument):
1790
1791 2015-11-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1792
1793         [EFL] Support an applicationVersion argument to UserAgentEfl::standardUserAgent() 
1794         https://bugs.webkit.org/show_bug.cgi?id=151060
1795
1796         Reviewed by Darin Adler.
1797
1798         *applicationVersion* was missed to support by r192148. This patch adds it as well as
1799         missed Darin comments are fixed.
1800
1801         * platform/efl/UserAgentEfl.cpp:
1802         (WebCore::platformVersionForUAString):
1803         (WebCore::versionForUAString):
1804         (WebCore::standardUserAgent):
1805
1806 2015-11-10  Simon Fraser  <simon.fraser@apple.com>
1807
1808         Use different pixel formats for displays that support them
1809         https://bugs.webkit.org/show_bug.cgi?id=151122
1810         rdar://problem/22846841
1811
1812         Reviewed by Tim Horton.
1813
1814         Add new IOSurface format enum values, and set up the appropriate IOSurfaceCreate()
1815         property dictionaries for them.
1816
1817         * platform/graphics/cocoa/IOSurface.h:
1818         * platform/graphics/cocoa/IOSurface.mm:
1819         (IOSurface::IOSurface):
1820         * platform/spi/cocoa/IOSurfaceSPI.h:
1821
1822 2015-11-10  Brent Fulgham  <bfulgham@apple.com>
1823
1824         Crash running webaudio/panner-loop.html
1825         https://bugs.webkit.org/show_bug.cgi?id=150200
1826         <rdar://problem/23136282>
1827
1828         Reviewed by Jer Noble.
1829
1830         Test: webaudio/panner-loop.html
1831
1832         This is based on the changes in Blink r164822:
1833         https://codereview.chromium.org/130003002
1834
1835         Avoid infinitely recursing on audio nodes by keeping track of which nodes we've already
1836         visited.
1837
1838         * Modules/webaudio/PannerNode.cpp:
1839         (WebCore::PannerNode::pullInputs): Pass set of visited nodes so we don't revisit
1840         nodes we've already serviced.
1841         (WebCore::PannerNode::notifyAudioSourcesConnectedToNode): Accept visitedNodes argument
1842         so we can avoid revisiting nodes. Check if the current node has already been visited
1843         before processing it.
1844         * Modules/webaudio/PannerNode.h:
1845
1846 2015-11-10  Tim Horton  <timothy_horton@apple.com>
1847
1848         Adopt formal protocols for CA delegates
1849         https://bugs.webkit.org/show_bug.cgi?id=151121
1850         <rdar://problem/6739193>
1851
1852         Reviewed by Anders Carlsson.
1853
1854         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
1855         Note that our WebActionDisablingCALayerDelegate is, in fact, a CALayerDelegate.
1856
1857         * platform/spi/cocoa/QuartzCoreSPI.h:
1858         Add empty protocol definitions where necessary.
1859
1860         * WebCore.xcodeproj/project.pbxproj:
1861         * platform/spi/mac/NSAccessibilitySPI.h: Added.
1862         * platform/spi/mac/NSApplicationSPI.h: Added.
1863         * platform/spi/mac/NSTextFinderSPI.h: Added.
1864         * platform/spi/mac/NSViewSPI.h: Added.
1865         Split out SPI headers from WebKit2's AppKitSPI.h.
1866         Add NSViewSPI to note that NSView is (internally) a CALayerDelegate,
1867         which WebHTMLView depends on.
1868
1869 2015-11-10  Zalan Bujtas  <zalan@apple.com>
1870
1871         Continuations with anonymous wrappers inside misplaces child renderers.
1872         https://bugs.webkit.org/show_bug.cgi?id=150908
1873
1874         When a child is appended to an inline container and the beforeChild is not a direct child, but 
1875         it is inside a generated subtree, we need to special case the inline split to form continuation.
1876
1877         RenderInline::splitInlines() assumes that beforeChild is always a direct child of the current
1878         inline container. However when beforeChild type requires wrapper content (such as table cells), the DOM and the
1879         render tree get out of sync. In such cases, we need to ensure that both the beforeChild and its siblings end up
1880         in the correct generated block.
1881
1882         Reviewed by Darin Adler and David Hyatt.
1883
1884         Test: fast/inline/continuation-with-anon-wrappers.html
1885
1886         * rendering/RenderInline.cpp:
1887         (WebCore::RenderInline::splitInlines):
1888         (WebCore::RenderInline::addChildToContinuation):
1889
1890 2015-11-10  Geoffrey Garen  <ggaren@apple.com>
1891
1892         alert, confirm, prompt, showModalDialog should be forbidden during page close and navigation
1893         https://bugs.webkit.org/show_bug.cgi?id=150980
1894
1895         Reviewed by Chris Dumez.
1896
1897         Tests: fast/events/beforeunload-alert.html
1898                fast/events/beforeunload-confirm.html
1899                fast/events/beforeunload-prompt.html
1900                fast/events/beforeunload-showModalDialog.html
1901                fast/events/pagehide-alert.html
1902                fast/events/pagehide-confirm.html
1903                fast/events/pagehide-prompt.html
1904                fast/events/pagehide-showModalDialog.html
1905                fast/events/unload-alert.html
1906                fast/events/unload-confirm.html
1907                fast/events/unload-prompt.html
1908                fast/events/unload-showModalDialog.html
1909
1910         * loader/FrameLoader.cpp:
1911         (WebCore::FrameLoader::stopLoading): Factored out a helper function for
1912         unload event processing.
1913         (WebCore::FrameLoader::handleUnloadEvents): Forbid prompts in unload
1914         events just like we do in beforeunload events, and for the same reasons.
1915
1916         (WebCore::FrameLoader::handleBeforeUnloadEvent): Updated for renames.
1917
1918         * loader/FrameLoader.h:
1919
1920         * page/DOMWindow.cpp:
1921         (WebCore::DOMWindow::print):
1922         (WebCore::DOMWindow::alert):
1923         (WebCore::DOMWindow::confirm):
1924         (WebCore::DOMWindow::prompt):
1925         (WebCore::DOMWindow::showModalDialog): Updated for renames. Refactored
1926         some of this code to handle null pages more cleanly. In particular, we
1927         sometimes used to treat null page as "everything is permitted" -- but it
1928         is best practice in a permissions context to treat lack of information
1929         as no permission granted rather than all permissions granted. (I don't
1930         know of a way to trigger this condition in practice.)
1931
1932         * page/Page.cpp:
1933         (WebCore::Page::Page):
1934         (WebCore::Page::forbidPrompts):
1935         (WebCore::Page::allowPrompts):
1936         (WebCore::Page::arePromptsAllowed): Renamed to make these functions
1937         reflect their new, broader context.
1938
1939         (WebCore::Page::incrementFrameHandlingBeforeUnloadEventCount): Deleted.
1940         (WebCore::Page::decrementFrameHandlingBeforeUnloadEventCount): Deleted.
1941         (WebCore::Page::isAnyFrameHandlingBeforeUnloadEvent): Deleted.
1942
1943         * page/Page.h:
1944
1945 2015-11-09  David Hyatt  <hyatt@apple.com>
1946
1947         tate-chu-yoko should shrink to fit when it exceeds the available width.
1948         <rdar://problem/12130468>
1949         https://bugs.webkit.org/show_bug.cgi?id=151051
1950
1951         Reviewed by Myles Maxfield.
1952
1953         Covered by existing tests
1954
1955         * rendering/RenderCombineText.cpp:
1956         (WebCore::RenderCombineText::combineText):
1957
1958         When testing for text-combine, find the font variant that is the best fit, i.e.,
1959         that exceeds the available width by the smallest amount. Scale that best fit down
1960         repeatedly until it fits within the available space. We set a pixel size of 6 as
1961         the threshold at which we give up.
1962
1963         Also make sure to reset glyphOverflow on each measurement, as this was creating
1964         a potential bug both with variant checking and then with scaling, since glyphOverflow
1965         isn't reset when width() is invoked.
1966
1967 2015-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
1968
1969         Tatechuyoko text is not vertically centered in its vertical advance
1970         https://bugs.webkit.org/show_bug.cgi?id=151074
1971         <rdar://problem/20074305>
1972
1973         Reviewed by David Hyatt.
1974
1975         During paint time, the run origin of tatechuyoko needs to be adjusted to compensate for the
1976         rotation of the writing mode. The calculation which performed this adjustment was incorrect.
1977
1978         It is incorrect for two reasons:
1979         1. It used the existing text origin, which had the font's ascent incorporated in it, but did
1980         not compensate by either inspecting the overflow bounds' ascent nor the font's ascent proper.
1981         2. It did not distinguish between the overflow bounds' ascent vs. descent. Instead, it added
1982         them together and treated both values together.
1983
1984         No new tests yet. I need to make a font to test this.
1985
1986         * rendering/InlineTextBox.cpp:
1987         (WebCore::InlineTextBox::paint):
1988         * rendering/RenderCombineText.cpp:
1989         (WebCore::RenderCombineText::computeTextOrigin):
1990         (WebCore::RenderCombineText::combineText):
1991         (WebCore::RenderCombineText::adjustTextOrigin): Deleted.
1992         * rendering/RenderCombineText.h:
1993
1994 2015-11-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1995
1996         XMLHttpRequestUpload should support ontimeout event handler
1997         https://bugs.webkit.org/show_bug.cgi?id=128531
1998
1999         Reviewed by Darin Adler.
2000
2001         Covered by rebased tests.
2002
2003         * xml/XMLHttpRequestUpload.idl: Adding ontimeout event handler.
2004
2005 2015-11-10  Zalan Bujtas  <zalan@apple.com>
2006
2007         Force display: block on ::-webkit-media-controls.
2008         https://bugs.webkit.org/show_bug.cgi?id=149178
2009         <rdar://problem/23448397>
2010
2011         Reviewed by Simon Fraser.
2012
2013         This patch ensures that we always have a block level container for media controls
2014         so that continuation never needs to split RenderMedia into multiple subtrees.
2015
2016         Current inline continuation logic assumes that only inline elements with RenderInline
2017         type of renderers participate in continuation. This is mostly the case since other inline renderers
2018         such as RenderReplaced, RenderImage, RenderEmbeddedObject etc can't have (accessible) children.
2019         (Unlike video::-webkit-media-controls)
2020
2021         Test: media/webkit-media-controls-display.html
2022
2023         * Modules/mediacontrols/mediaControlsApple.css:
2024         (::-webkit-media-controls):
2025         * Modules/mediacontrols/mediaControlsiOS.css:
2026         (::-webkit-media-controls):
2027         * css/mediaControls.css:
2028         (::-webkit-media-controls):
2029
2030 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2031
2032         [GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
2033         https://bugs.webkit.org/show_bug.cgi?id=150642
2034
2035         Reviewed by Martin Robinson.
2036
2037         Remove GTK+ implementations of old context menu classes.
2038
2039         * PlatformGTK.cmake:
2040         * platform/ContextMenuItem.h:
2041         * platform/gtk/ContextMenuGtk.cpp: Removed.
2042         * platform/gtk/ContextMenuItemGtk.cpp: Removed.
2043
2044 2015-11-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2045
2046         [Streams API] Fix style issues
2047         https://bugs.webkit.org/show_bug.cgi?id=151089
2048
2049         Reviewed by Youenn Fablet.
2050
2051         Inlined some things, converted var into let and const, removed some undefined parameters and returns, added
2052         missing "use strict" clauses and other minor style changes.
2053
2054         Internal rework, no new tests needed.
2055
2056         * Modules/streams/ReadableStream.js:
2057         (initializeReadableStream):
2058         * Modules/streams/ReadableStreamController.js:
2059         (enqueue):
2060         (error):
2061         (close):
2062         * Modules/streams/ReadableStreamInternals.js:
2063         (teeReadableStream):
2064         (teeReadableStreamPullFunction):
2065         (teeReadableStreamBranch2CancelFunction):
2066         (errorReadableStream):
2067         (finishClosingReadableStream):
2068         (closeReadableStreamReader):
2069         (enqueueInReadableStream):
2070         (readFromReadableStreamReader):
2071         * Modules/streams/ReadableStreamReader.js:
2072         (releaseLock):
2073         * Modules/streams/StreamInternals.js:
2074         (invokeOrNoop):
2075         (promiseInvokeOrNoop):
2076         (promiseInvokeOrFallbackOrNoop):
2077         (validateAndNormalizeQueuingStrategy):
2078         (newQueue):
2079         (dequeueValue):
2080         (enqueueValueWithSize):
2081         (peekQueueValue):
2082         * Modules/streams/WritableStream.js:
2083         (initializeWritableStream):
2084         (abort):
2085         (close):
2086         * Modules/streams/WritableStreamInternals.js:
2087         (syncWritableStreamStateWithQueue):
2088         (errorWritableStream):
2089         (callOrScheduleWritableStreamAdvanceQueue):
2090         (writableStreamAdvanceQueue):
2091         (closeWritableStream): Deleted.
2092
2093 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2094
2095         Unreviewed. Fix scrollbars/custom-scrollbar-appearance-property.html after r191991.
2096
2097         Use a similar fix to the mac one.
2098
2099         * rendering/RenderThemeGtk.cpp:
2100         (WebCore::centerRectVerticallyInParentInputElement):
2101
2102 2015-11-10  Csaba Osztrogonác  <ossy@webkit.org>
2103
2104         Unreviewed speculative buildfix after r192200.
2105
2106         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2107         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
2108
2109 2015-11-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2110
2111         [Streams API] Shield promises when prototype is replaced from a promise
2112         https://bugs.webkit.org/show_bug.cgi?id=151033
2113
2114         Reviewed by Darin Adler.
2115
2116         Instead of calling @then or @catch, that could have disappeared if the user successfully replaces a promise
2117         constructor, we call the methods stored at @Promise.prototype, which are safe as @Promise.prototype.@then.@call
2118         and @Promise.prototype.@catch.@call.
2119
2120         Test: streams/streams-promises.html, expectations updated.
2121
2122         * Modules/streams/ReadableStream.js:
2123         (initializeReadableStream):
2124         * Modules/streams/ReadableStreamInternals.js:
2125         (teeReadableStream):
2126         (teeReadableStreamPullFunction):
2127         (teeReadableStreamBranch2CancelFunction):
2128         (cancelReadableStream):
2129         * Modules/streams/WritableStream.js:
2130         (initializeWritableStream):
2131         (abort):
2132         * Modules/streams/WritableStreamInternals.js:
2133         (callOrScheduleWritableStreamAdvanceQueue):
2134
2135 2015-11-10  Jon Lee  <jonlee@apple.com>
2136
2137         REGRESSION (r189567): Inline controls on Mac are misplaced
2138         https://bugs.webkit.org/show_bug.cgi?id=151072
2139
2140         Reviewed by Eric Carlson.
2141
2142         Test: media/controls/fullscreen-button-inline-layout.html
2143
2144         For a certain range of video widths, r189567 caused the timeline track to be
2145         too large, pushing the buttons on the right side of the inline controls out of
2146         the rect bounds.
2147
2148         The fix is to set min-width to 0. The test added checks to see that the right
2149         edge of the fullscreen button is within the rect bounds.
2150
2151         * Modules/mediacontrols/mediaControlsApple.css:
2152         (audio::-webkit-media-controls-timeline-container): Add min-width.
2153         (audio::-webkit-media-controls-panel .thumbnail-track): Ditto. Fly-by fix of height rule.
2154
2155 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
2156
2157         [Mac] Add a mock AppleTV device for testing
2158         https://bugs.webkit.org/show_bug.cgi?id=148912
2159         <rdar://problem/22596272>
2160
2161         Reviewed by Tim Horton.
2162
2163         No new tests, updated media/controls/airplay-picker.html.
2164
2165         * Modules/mediasession/WebMediaSessionManager.cpp:
2166         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): New, enable or disable
2167           the mock picker.
2168         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): New, set mock picker state.
2169         (WebCore::WebMediaSessionManager::mockPicker): New.
2170         (WebCore::WebMediaSessionManager::targetPicker): Return the platform or mock picker, as per settings.
2171         (WebCore::webMediaSessionManagerOverride): Deleted.
2172         (WebCore::WebMediaSessionManager::shared): Deleted.
2173         (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): Deleted.
2174         * Modules/mediasession/WebMediaSessionManager.h:
2175
2176         * WebCore.xcodeproj/project.pbxproj: Add MediaPlaybackTargetPickerMock.* and MediaPlaybackTargetMock.*.
2177
2178         * page/ChromeClient.h: add setMockMediaPlaybackTargetPickerEnabled and setMockMediaPlaybackTargetPickerState.
2179
2180         * page/Page.cpp:
2181         (WebCore::Page::playbackTargetPickerClientStateDidChange):
2182         (WebCore::Page::setMockMediaPlaybackTargetPickerEnabled): New.
2183         (WebCore::Page::setMockMediaPlaybackTargetPickerState): New.
2184         (WebCore::Page::setPlaybackTarget):
2185         * page/Page.h:
2186
2187         * platform/graphics/MediaPlaybackTarget.h:
2188         (WebCore::noMediaPlaybackTargetContext):
2189         (WebCore::MediaPlaybackTarget::~MediaPlaybackTarget):
2190         (WebCore::MediaPlaybackTarget::deviceName):
2191         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
2192
2193         * platform/graphics/MediaPlaybackTargetContext.h: Make a class instead of a struct.
2194         (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
2195         (WebCore::MediaPlaybackTargetContext::type):
2196         (WebCore::MediaPlaybackTargetContext::mockDeviceName):
2197         (WebCore::MediaPlaybackTargetContext::mockState):
2198         (WebCore::MediaPlaybackTargetContext::avOutputContext):
2199         (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData):
2200
2201         * platform/graphics/MediaPlaybackTargetPicker.cpp: Move much of the code from MediaPlaybackTargetMac.mm
2202           here so it can be the base class.
2203         (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
2204         (WebCore::MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker):
2205         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
2206         (WebCore::MediaPlaybackTargetPicker::addPendingAction):
2207         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
2208         * platform/graphics/MediaPlaybackTargetPicker.h:
2209         (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
2210         (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
2211         (WebCore::MediaPlaybackTargetPicker::client):
2212         (WebCore::MediaPlaybackTargetPicker::setClient):
2213
2214         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h:
2215         (WebCore::MediaPlaybackTargetMac::outputContext):
2216         (WebCore::MediaPlaybackTargetMac::targetType): Deleted.
2217         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2218         (WebCore::MediaPlaybackTargetMac::targetContext):
2219         (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
2220         (WebCore::MediaPlaybackTargetMac::deviceName):
2221
2222         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
2223         (WebCore::WebMediaSessionManager::shared): Renamed from platformManager.
2224         (WebCore::WebMediaSessionManagerMac::platformPicker): Renamed from targetPicker.
2225         (WebCore::WebMediaSessionManager::platformManager): Deleted.
2226         (WebCore::WebMediaSessionManagerMac::targetPicker): Deleted.
2227         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
2228
2229         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2230         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2231         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
2232         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
2233         (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
2234         (WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
2235         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
2236         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
2237         (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets):
2238         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Deleted.
2239         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Deleted.
2240         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): Deleted.
2241         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Deleted.
2242
2243         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2244         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2245         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): Add support for
2246           mock target.
2247         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto.
2248         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Ditto.
2249         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Ditto.
2250
2251         * platform/mock/MediaPlaybackTargetMock.cpp: Added.
2252         (WebCore::MediaPlaybackTargetMock::create): 
2253         (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
2254         (WebCore::MediaPlaybackTargetMock::~MediaPlaybackTargetMock):
2255         (WebCore::MediaPlaybackTargetMock::targetContext):
2256         (WebCore::toMediaPlaybackTargetMock):
2257         * platform/mock/MediaPlaybackTargetMock.h: Added.
2258
2259         * platform/mock/MediaPlaybackTargetPickerMock.cpp: Added.
2260         (WebCore::MediaPlaybackTargetPickerMock::create):
2261         (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
2262         (WebCore::MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock):
2263         (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
2264         (WebCore::MediaPlaybackTargetPickerMock::playbackTarget):
2265         (WebCore::MediaPlaybackTargetPickerMock::timerFired):
2266         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
2267         (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
2268         (WebCore::MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets):
2269         (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
2270         (WebCore::MediaPlaybackTargetPickerMock::setState):
2271         * platform/mock/MediaPlaybackTargetPickerMock.h: Added.
2272
2273         * testing/Internals.cpp:
2274         (WebCore::Internals::Internals):
2275         (WebCore::Internals::setMockMediaPlaybackTargetPickerEnabled):
2276         (WebCore::Internals::setMockMediaPlaybackTargetPickerState):
2277         * testing/Internals.h:
2278         * testing/Internals.idl:
2279
2280 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2281
2282         Unreviewed, fix the windows build
2283
2284         Update the signature of scrollableAreaBoundingBox, changed by r192193.
2285
2286         * platform/win/PopupMenuWin.cpp:
2287         (WebCore::PopupMenuWin::scrollableAreaBoundingBox):
2288         * platform/win/PopupMenuWin.h:
2289
2290 2015-11-09  Simon Fraser  <simon.fraser@apple.com>
2291
2292         Allow iOS to create linearRGB colorspaces
2293         https://bugs.webkit.org/show_bug.cgi?id=151059
2294
2295         Reviewed by Tim Horton.
2296
2297         Remove iOS #ifdefs around code that creates linearized RGB colorspaces, as used
2298         by SVG filters. Blending doesn't actually work correctly, but there's no reason
2299         to #ifdef differently here.
2300
2301         * platform/graphics/cg/GraphicsContextCG.cpp:
2302         * platform/graphics/mac/GraphicsContextMac.mm:
2303         (WebCore::linearRGBColorSpaceRef):
2304
2305 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2306
2307         Sometimes unable to scroll fixed div when the body is scrollable
2308         https://bugs.webkit.org/show_bug.cgi?id=151015
2309         <rdar://problem/23445723>
2310
2311         Reviewed by Simon Fraser.
2312
2313         Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed
2314         area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed
2315         overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region
2316         corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page,
2317         wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits.
2318
2319         We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element
2320         also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region
2321         to behave the same way as fixed scrollable elements above.
2322
2323         This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView.
2324
2325         Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html
2326
2327         * page/FrameView.cpp:
2328         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
2329         (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
2330         * page/FrameView.h:
2331         * page/scrolling/ScrollingCoordinator.cpp:
2332         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
2333         * platform/ScrollableArea.h:
2334         (WebCore::ScrollableArea::scrollableAreaBoundingBox):
2335         * rendering/RenderLayer.cpp:
2336         (WebCore::RenderLayer::scrollableAreaBoundingBox):
2337         * rendering/RenderLayer.h:
2338         * rendering/RenderLayerCompositor.cpp:
2339         (WebCore::RenderLayerCompositor::computeExtent):
2340         (WebCore::fixedPositionOffset): Deleted.
2341         * rendering/RenderView.cpp:
2342         (WebCore::RenderView::mapLocalToContainer):
2343         (WebCore::RenderView::pushMappingToContainer):
2344         (WebCore::RenderView::mapAbsoluteToLocalPoint):
2345         (WebCore::RenderView::computeRectForRepaint):
2346         (WebCore::fixedPositionOffset): Deleted.
2347
2348 2015-11-09  Ryan Haddad  <ryanhaddad@apple.com>
2349
2350         Unreviewed, rolling out r192181.
2351
2352         This change causes asserts on mac-wk1 debug testers
2353
2354         Reverted changeset:
2355
2356         "Fixed crash loading Mozilla layout test
2357         editor/libeditor/crashtests/431086-1.xhtml."
2358         https://bugs.webkit.org/show_bug.cgi?id=150252
2359         http://trac.webkit.org/changeset/192181
2360
2361 2015-11-09  Jiewen Tan  <jiewen_tan@apple.com>
2362
2363         Crash when right clicking in input box with -webkit-user-select: none
2364         https://bugs.webkit.org/show_bug.cgi?id=145981
2365         <rdar://problem/22441925>
2366
2367         Reviewed by Enrica Casucci.
2368
2369         Test: editing/selection/minimal-user-select-crash.html
2370
2371         * editing/Editor.cpp:
2372         (WebCore::Editor::hasBidiSelection):
2373         Visible position cannot be created because of the style that doesn't allow the selection.
2374
2375 2015-11-09  Joseph Pecoraro  <pecoraro@apple.com>
2376
2377         Web Inspector: $0 stops working after navigating to a different domain
2378         https://bugs.webkit.org/show_bug.cgi?id=147962
2379
2380         Reviewed by Brian Burg.
2381
2382         Test: http/tests/inspector/console/cross-domain-inspected-node-access.html
2383
2384         The inspector backend injects the CommandLineAPI Source with a
2385         corresponding CommandLineAPIHost into each execution context
2386         created by the page (main frame, sub frames, etc).
2387
2388         When creating the JSValue wrapper for the CommandLineAPIHost using
2389         the generated toJS(...) DOM bindings, we were using the cached
2390         CommandLineAPIHost wrapper values in the single DOMWrapperWorld shared
2391         across all frames. This meant that the first time the wrapper was
2392         needed it was created in context A. But when needed for context B
2393         it was using the wrapper created in context A. Using this wrapper
2394         in context B was producing unexpected cross-origin warnings.
2395
2396         The solution taken here, is to create a new JSValue wrapper for
2397         the CommandLineAPIHost per execution context. This way each time
2398         the CommandLineAPIHost wrapper is used in a frame, it is using
2399         the one created for that frame.
2400
2401         The C++ host object being wrapped has a lifetime equivalent to
2402         the Page. It does not change in this patch. The wrapper values
2403         are cleared on page navigation or when the page is closed, and
2404         will be garbage collected.
2405
2406         * WebCore.vcxproj/WebCore.vcxproj:
2407         * WebCore.vcxproj/WebCore.vcxproj.filters:
2408         * ForwardingHeaders/inspector/PerGlobalObjectWrapperWorld.h: Added.
2409         New forwarding header.
2410
2411         * inspector/CommandLineAPIHost.h:
2412         * inspector/CommandLineAPIHost.cpp:
2413         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
2414         (WebCore::CommandLineAPIHost::wrapper):
2415         Cached JSValue wrappers per GlobalObject.
2416
2417         (WebCore::CommandLineAPIHost::clearAllWrappers):
2418         Clear any wrappers we have, including the $0 value itself
2419         which we weren't explicitly clearing previously.
2420
2421         * inspector/CommandLineAPIModule.cpp:
2422         (WebCore::CommandLineAPIModule::host):
2423         Simplify creating the wrapper.
2424
2425         * inspector/WebInjectedScriptManager.h:
2426         * inspector/WebInjectedScriptManager.cpp:
2427         (WebCore::WebInjectedScriptManager::discardInjectedScripts):
2428         When the main frame window object clears, also clear the
2429         CommandLineAPI wrappers we may have created. Also take this
2430         opportunity to clear any $0 value that may have pointed
2431         to a value in the previous page.
2432
2433 2015-11-09  Per Arne Vollan  <peavo@outlook.com>
2434
2435         [WinCairo][Video][MediaFoundation] Video should be rendered in provided graphics context.
2436         https://bugs.webkit.org/show_bug.cgi?id=150941
2437
2438         Reviewed by Brent Fulgham.
2439
2440         On WinCairo, we currently render video in a child window of the main browser window.
2441         This makes it difficult to render things on top of the video, like video controls and
2442         context menus. We should render the video in the graphics context provided by the paint
2443         method. This is done by implementing a custom EVR (Enhanced Video Renderer) presenter
2444         for Media Foundation.
2445
2446         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2447         (MFCreateMediaType):
2448         (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
2449         (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine):
2450         (WebCore::MediaPlayerPrivateMediaFoundation::isAvailable):
2451         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
2452         (WebCore::MediaPlayerPrivateMediaFoundation::paint):
2453         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
2454         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
2455         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow):
2456         (WebCore::MediaPlayerPrivateMediaFoundation::destroyVideoWindow):
2457         (WebCore::MediaPlayerPrivateMediaFoundation::invalidateFrameView):
2458         (WebCore::MediaPlayerPrivateMediaFoundation::addListener):
2459         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
2460         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
2461         (WebCore::MediaPlayerPrivateMediaFoundation::AsyncCallback::onMediaPlayerDeleted):
2462         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CustomVideoPresenter):
2463         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::~CustomVideoPresenter):
2464         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::QueryInterface):
2465         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::AddRef):
2466         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Release):
2467         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStart):
2468         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockStop):
2469         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockPause):
2470         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockRestart):
2471         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::OnClockSetRate):
2472         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ProcessMessage):
2473         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentMediaType):
2474         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDeviceID):
2475         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::InitServicePointers):
2476         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ReleaseServicePointers):
2477         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetService):
2478         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ActivateObject):
2479         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DetachObject):
2480         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::ShutdownObject):
2481         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoWindow):
2482         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoWindow):
2483         (WebCore::setMixerSourceRect):
2484         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetVideoPosition):
2485         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetVideoPosition):
2486         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::RepaintVideo):
2487         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Invoke):
2488         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onMediaPlayerDeleted):
2489         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame):
2490         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
2491         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::configureMixer):
2492         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::flush):
2493         (WebCore::areMediaTypesEqual):
2494         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::setMediaType):
2495         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkShutdown):
2496         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::renegotiateMediaType):
2497         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
2498         (WebCore::MFOffsetToFloat):
2499         (WebCore::MakeOffset):
2500         (WebCore::MakeArea):
2501         (WebCore::validateVideoArea):
2502         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::beginStreaming):
2503         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::endStreaming):
2504         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::checkEndOfStream):
2505         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isMediaTypeSupported):
2506         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
2507         (WebCore::correctAspectRatio):
2508         (WebCore::GetVideoDisplayArea):
2509         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::calculateOutputRectangle):
2510         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutputLoop):
2511         (WebCore::setDesiredSampleTime):
2512         (WebCore::clearDesiredSampleTime):
2513         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processOutput):
2514         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::deliverSample):
2515         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::trackSample):
2516         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::releaseResources):
2517         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::onSampleFree):
2518         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::notifyEvent):
2519         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::getSample):
2520         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::returnSample):
2521         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::areSamplesPending):
2522         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::initialize):
2523         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::clear):
2524         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setFrameRate):
2525         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::startScheduler):
2526         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
2527         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::flush):
2528         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::scheduleSample):
2529         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
2530         (WebCore::MFTimeToMilliseconds):
2531         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSample):
2532         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProc):
2533         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
2534         (WebCore::findAdapter):
2535         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::Direct3DPresenter):
2536         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::~Direct3DPresenter):
2537         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getService):
2538         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkFormat):
2539         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setVideoWindow):
2540         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::setDestinationRect):
2541         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
2542         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::releaseResources):
2543         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::checkDeviceState):
2544         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
2545         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2546         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::initializeD3D):
2547         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DDevice):
2548         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createD3DSample):
2549         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSwapChain):
2550         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getSwapChainPresentParameters):
2551         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect):
2552         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2553         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::VideoSamplePool):
2554         (WebCore::MediaPlayerPrivateMediaFoundation::VideoSamplePool::~VideoSamplePool):
2555         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::VideoScheduler):
2556         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::~VideoScheduler):
2557         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setPresenter):
2558         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::setClockRate):
2559         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::lastSampleTime):
2560         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::frameDuration):
2561         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getVideoWindow):
2562         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::getDestinationRect):
2563         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::refreshRate):
2564         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItem):
2565         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemType):
2566         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CompareItem):
2567         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::Compare):
2568         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT32):
2569         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUINT64):
2570         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetDouble):
2571         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetGUID):
2572         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetStringLength):
2573         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetString):
2574         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedString):
2575         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlobSize):
2576         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBlob):
2577         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAllocatedBlob):
2578         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetUnknown):
2579         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetItem):
2580         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteItem):
2581         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::DeleteAllItems):
2582         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT32):
2583         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUINT64):
2584         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetDouble):
2585         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetGUID):
2586         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetString):
2587         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBlob):
2588         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetUnknown):
2589         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::LockStore):
2590         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::UnlockStore):
2591         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCount):
2592         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetItemByIndex):
2593         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::CopyAllItems):
2594         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetNativeVideoSize):
2595         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetIdealVideoSize):
2596         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetAspectRatioMode):
2597         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetAspectRatioMode):
2598         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetCurrentImage):
2599         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetBorderColor):
2600         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetBorderColor):
2601         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetRenderingPrefs):
2602         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetRenderingPrefs):
2603         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::SetFullscreen):
2604         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetFullscreen):
2605         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::GetParameters):
2606         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isScrubbing):
2607
2608 2015-11-09  Alex Christensen  <achristensen@webkit.org>
2609
2610         XHR timeouts should not fire if there is an immediate network error.
2611         https://bugs.webkit.org/show_bug.cgi?id=150577
2612
2613         Reviewed by Darin Adler.
2614
2615         This fixes flakiness of http/tests/contentextensions/async-xhr-onerror.html since r191077.
2616
2617         * xml/XMLHttpRequest.cpp:
2618         (WebCore::XMLHttpRequest::createRequest):
2619         (WebCore::XMLHttpRequest::internalAbort):
2620         (WebCore::XMLHttpRequest::didFinishLoading):
2621         If the timeout timer has been started and we are going to immediately report a network error, then stop the timeout timer.
2622         The timeout timer sometimes fired before the network error timer if it was a very short timeout (such as 1ms).
2623         Also checks to isActive before calling stop on a timer are not necessary.
2624
2625 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
2626
2627         [MediaStream] Add mock audio and video sources
2628         https://bugs.webkit.org/show_bug.cgi?id=150997
2629         <rdar://problem/23453358>
2630
2631         Reviewed by Jer Noble.
2632
2633         Create basic mock audio and video realtime media source classes so we can test MediaStream
2634         API without requiring test machines to have audio/video input hardware. No new tests added
2635         yet, thoe will follow.
2636
2637         No new tests, these changes will allow us to write MediaStream tests.
2638
2639         * CMakeLists.txt: Add MockRealtimeAudioSource.cpp, MockRealtimeMediaSource.cpp, and 
2640           MockRealtimeVideoSource.cpp
2641
2642         * PlatformMac.cmake: Add MockRealtimeVideoSourceMac.mm
2643
2644         * WebCore.xcodeproj/project.pbxproj: Add new files.
2645
2646         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2647         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Don't set autoresizingMask,
2648           it isn't necessary.
2649
2650         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2651         (WebCore::refreshCaptureDeviceList): AVCaptureDevice -> getAVCaptureDeviceClass()
2652         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Ditto.
2653         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
2654
2655         Mac class implements RealtimeVideoSource::platformLayer, returns a CALayer which uses the
2656         GraphicsContext as contents.
2657         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: Added.
2658         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: Added.
2659         (WebCore::MockRealtimeVideoSource::create):
2660         (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac):
2661         (WebCore::MockRealtimeVideoSourceMac::platformLayer):
2662         (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
2663
2664         Mock audio source. Doesn't provide data yet, only provides states and capabilities.
2665         * platform/mock/MockRealtimeAudioSource.cpp: Added.
2666         (WebCore::MockRealtimeAudioSource::create):
2667         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource):
2668         (WebCore::MockRealtimeAudioSource::updateStates):
2669         (WebCore::MockRealtimeAudioSource::initializeCapabilities):
2670         * platform/mock/MockRealtimeAudioSource.h: Added.
2671         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
2672
2673         Mock source base class, sets persistent ID and updates states and capabilities.
2674         * platform/mock/MockRealtimeMediaSource.cpp: Added.
2675         (WebCore::MockRealtimeMediaSource::mockAudioPersistentID):
2676         (WebCore::MockRealtimeMediaSource::mockVideoPersistentID):
2677         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
2678         (WebCore::MockRealtimeMediaSource::capabilities):
2679         (WebCore::MockRealtimeMediaSource::states):
2680         * platform/mock/MockRealtimeMediaSource.h: Added.
2681         (WebCore::MockRealtimeMediaSource::mockAudioSourcePersistentID):
2682         (WebCore::MockRealtimeMediaSource::mockAudioSourceName):
2683         (WebCore::MockRealtimeMediaSource::mockVideoSourcePersistentID):
2684         (WebCore::MockRealtimeMediaSource::mockVideoSourceName):
2685         (WebCore::MockRealtimeMediaSource::trackSourceWithUID):
2686         (WebCore::MockRealtimeMediaSource::~MockRealtimeMediaSource):
2687         (WebCore::MockRealtimeMediaSource::currentStates):
2688         (WebCore::MockRealtimeMediaSource::constraints):
2689
2690         Use new mock source classes. Create a new source instance for each request instead of reusing the
2691         same sources each time.
2692         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2693         (WebCore::mockSourceMap):
2694         (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter):
2695         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
2696         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2697         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
2698         (WebCore::MockSource::MockSource): Deleted.
2699         (WebCore::MockSource::~MockSource): Deleted.
2700         (WebCore::MockSource::capabilities): Deleted.
2701         (WebCore::MockSource::states): Deleted.
2702         (WebCore::mockAudioSourceID): Deleted.
2703         (WebCore::mockVideoSourceID): Deleted.
2704         (WebCore::initializeMockSources): Deleted.
2705
2706         Mock video source. Generate bip-bop inspired frames with burned in state information.
2707         * platform/mock/MockRealtimeVideoSource.cpp: Added.
2708         (WebCore::MockRealtimeVideoSource::create):
2709         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
2710         (WebCore::MockRealtimeVideoSource::startProducingData):
2711         (WebCore::MockRealtimeVideoSource::stopProducingData):
2712         (WebCore::MockRealtimeVideoSource::elapsedTime):
2713         (WebCore::MockRealtimeVideoSource::updateStates):
2714         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
2715         (WebCore::MockRealtimeVideoSource::setFacingMode):
2716         (WebCore::MockRealtimeVideoSource::setFrameRate):
2717         (WebCore::MockRealtimeVideoSource::setSize):
2718         (WebCore::MockRealtimeVideoSource::drawAnimation):
2719         (WebCore::MockRealtimeVideoSource::drawBoxes):
2720         (WebCore::MockRealtimeVideoSource::drawText):
2721         (WebCore::MockRealtimeVideoSource::generateFrame):
2722         (WebCore::MockRealtimeVideoSource::imageBuffer):
2723         (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext):
2724         (WebCore::MockRealtimeVideoSource::currentFrameImage):
2725         * platform/mock/MockRealtimeVideoSource.h: Added.
2726         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
2727         (WebCore::MockRealtimeVideoSource::size):
2728         (WebCore::MockRealtimeVideoSource::updatePlatformLayer):
2729
2730 2015-11-09  Nan Wang  <n_wang@apple.com>
2731
2732         AX: Input type: time is not accessible on iOS
2733         https://bugs.webkit.org/show_bug.cgi?id=150984
2734
2735         Reviewed by Chris Fleizach.
2736
2737         Exposed input type: time as popup button on iOS.
2738
2739         Test: accessibility/ios-simulator/input-type-time.html
2740
2741         * accessibility/AccessibilityRenderObject.cpp:
2742         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2743
2744 2015-11-09  Jiewen Tan  <jiewen_tan@apple.com>
2745
2746         Null dereference loading Blink layout test editing/inserting/insert-html-crash-01.html
2747         https://bugs.webkit.org/show_bug.cgi?id=149298
2748         <rdar://problem/22746918>
2749
2750         Reviewed by Ryosuke Niwa.
2751
2752         The test crashes in the method WebCore::CompositeEditCommand::moveParagraphs() because
2753         the other method WebCore::CompositeEditCommand::cleanupAfterDeletion() accidentally
2754         deletes the destination node. In WebCore::CompositeEditCommand::cleanupAfterDeletion(),
2755         it fails to determine that caretAfterDelete equals to destination as Position::operator==,
2756         which is called in VisiblePosition::operator==, only checks the equality of tuple
2757         <Anchor Node, Anchor Type, Offset>. It is insufficient as a single position can be
2758         represented by multiple tuples. Therefore, this change adds Position::equals() to fortify
2759         the equal checking of two positions by considering combinations of different tuple
2760         representations.
2761
2762         Furthermore, it adds VisiblePosition::equals() which considers affinity and call
2763         Position::equals() while comparing two visible positions.
2764
2765         Test: editing/inserting/insert-html-crash-01.html
2766
2767         * dom/Position.cpp:
2768         (WebCore::Position::equals):
2769         * dom/Position.h:
2770         * editing/CompositeEditCommand.cpp:
2771         (WebCore::CompositeEditCommand::cleanupAfterDeletion):
2772         Replace operator== with VisiblePosition::equals() to tackle the test case.
2773         * editing/VisiblePosition.cpp:
2774         (WebCore::VisiblePosition::equals):
2775         * editing/VisiblePosition.h:
2776
2777 2015-11-09  Myles C. Maxfield  <mmaxfield@apple.com>
2778
2779         Some style changes cause tatechuyoko to be drawn off center
2780         https://bugs.webkit.org/show_bug.cgi?id=150986
2781         <rdar://problem/20748013>
2782
2783         Reviewed by Darin Adler.
2784
2785         Layouts should be idempotent. In particular, during layout, an element should not
2786         rely on a previous call to styleDidChange() with a sufficiently high StyleDifference.
2787         RenderCombineText was assuming that, if a layout occurs, a previous call to
2788         styleDidChange() would have reset the renderedText. However, an ancestor element might
2789         cause the RenderCombineText to re-combine when it is already combined. Therefore, the
2790         recombination should fully uncombine before recombining.
2791
2792         Test: fast/text/text-combine-style-change-extra-layout.html
2793
2794         * rendering/RenderCombineText.cpp:
2795         (WebCore::RenderCombineText::combineText): Fully uncombine before recombining.
2796
2797 2015-11-09  Brent Fulgham  <bfulgham@apple.com>
2798
2799         [Win] Recognize context flush as an event that requires an update
2800         https://bugs.webkit.org/show_bug.cgi?id=151001
2801         <rdar://problem/22956040>
2802
2803         Reviewed by Simon Fraser.
2804
2805         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2806         (WebCore::WKCACFViewLayerTreeHost::flushContext): Mark view as needing an update
2807         when flushing so internal drawing code will do the paint.
2808         * rendering/RenderLayerBacking.cpp:
2809         (WebCore::RenderLayerBacking::paintIntoLayer): Skip WK2 assert that does
2810         not apply to Windows drawing path.
2811
2812 2015-11-09  Brady Eidson  <beidson@apple.com>
2813
2814         Modern IDB: Refactor memory objectstore/transaction interation.
2815         https://bugs.webkit.org/show_bug.cgi?id=151014
2816
2817         Reviewed by Darin Adler.
2818
2819         No new tests (Refactor, no change in behavior).
2820
2821         * Modules/indexeddb/server/IDBBackingStore.h:
2822         
2823         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2824         (WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged):
2825         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2826         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2827         
2828         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2829         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2830         (WebCore::IDBServer::MemoryIDBBackingStore::putRecord): Deleted. Renamed to addRecord.
2831         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2832         
2833         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2834         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
2835         (WebCore::IDBServer::MemoryObjectStore::addRecord):
2836         (WebCore::IDBServer::MemoryObjectStore::putRecord): Deleted. Renamed to addRecord.
2837         (WebCore::IDBServer::MemoryObjectStore::setKeyValue): Deleted. Folded into addRecord.
2838         * Modules/indexeddb/server/MemoryObjectStore.h:
2839         
2840         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2841         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2842
2843 2015-11-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
2844
2845         REGRESSION (r190883): Error calculating the tile size for an SVG with no intrinsic size but with large floating intrinsic ratio
2846         https://bugs.webkit.org/show_bug.cgi?id=150904
2847
2848         Reviewed by Darin Adler.
2849         
2850         This patch addresses two issues. The first one is a regression from r190883
2851         which was rolling out r184895. There was a missing if-statement in 
2852         RenderBoxModelObject::calculateImageIntrinsicDimension(). We should return
2853         it back. But this if-statement is an optimization; if we hit it we should
2854         return the image resolvedSize. But we should also return the same result
2855         if we call resolveAgainstIntrinsicWidthOrHeightAndRatio().
2856         
2857         We had a bug in resolving the intrinsic size of an image using a large
2858         intrinsic ratio. We need to do the calculation in LayoutUnits always.
2859         Using float calculations and then casting the output to an integer results
2860         in significant truncation if the intrinsic ratio is large.
2861
2862         Test: fast/backgrounds/background-image-large-float-intrinsic-ratio.html
2863
2864         * rendering/RenderBoxModelObject.cpp:
2865         (WebCore::resolveWidthForRatio):
2866         (WebCore::resolveHeightForRatio):
2867         (WebCore::resolveAgainstIntrinsicWidthOrHeightAndRatio):
2868         (WebCore::resolveAgainstIntrinsicRatio):
2869         Resolve the image size using its intrinsic ratio in LayoutUnits.
2870         
2871         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
2872         Put back an if-statement which was missing from rolling out r184895
2873
2874 2015-11-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2875
2876         [Streams API] Activate assertions
2877         https://bugs.webkit.org/show_bug.cgi?id=151021
2878
2879         Reviewed by Darin Adler.
2880
2881         Activating assertions in streams API.
2882         Fixing a bug in ReadableStream implementation: when pull promise is rejected,
2883         the readable stream may already be errored by some other means.
2884
2885         Covered by existing test sets in Debug builds.
2886
2887         * Modules/streams/ReadableStreamInternals.js:
2888         (teeReadableStream):
2889         (teeReadableStreamPullFunction):
2890         (errorReadableStream):
2891         (requestReadableStreamPull):
2892         (finishClosingReadableStream):
2893         (closeReadableStream):
2894         (enqueueInReadableStream):
2895         (readFromReadableStreamReader):
2896         * Modules/streams/ReadableStreamReader.js:
2897         (cancel):
2898         * Modules/streams/StreamInternals.js:
2899         (peekQueueValue):
2900         * Modules/streams/WritableStream.js:
2901         (write):
2902         (state):
2903         * Modules/streams/WritableStreamInternals.js:
2904         (syncWritableStreamStateWithQueue):
2905         (closeWritableStream): Deleted.
2906
2907 2015-11-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2908
2909         [Streams API] Shield implementation from mangling then and catch promise methods
2910         https://bugs.webkit.org/show_bug.cgi?id=150934
2911
2912         Reviewed by Youenn Fablet.
2913
2914         This is a first step to get streams code shielded from user replacing the then and catch methods in our
2915         promises. We use newly introduced @then and @catch prototype internal slots and that should solve a lot of use
2916         cases.
2917
2918         Test: streams/streams-promises.html.
2919
2920         * Modules/streams/ReadableStream.js:
2921         (initializeReadableStream):
2922         * Modules/streams/ReadableStreamInternals.js:
2923         (teeReadableStream):
2924         (teeReadableStreamPullFunction):
2925         (cancelReadableStream):
2926         * Modules/streams/WritableStream.js:
2927         (initializeWritableStream):
2928         (abort):
2929         * Modules/streams/WritableStreamInternals.js:
2930         (callOrScheduleWritableStreamAdvanceQueue):
2931
2932 2015-11-09  Manuel Rego Casasnovas  <rego@igalia.com>
2933
2934         [css-grid] Refactor cachedGridCoordinate() to cachedGridSpan()
2935         https://bugs.webkit.org/show_bug.cgi?id=151017
2936
2937         Reviewed by Sergio Villar Senin.
2938
2939         We were using cachedGridCoordinate() in lots of places and checking the
2940         direction just in the next line. Creating a generic function to do this.
2941
2942         No new tests, no behavior change.
2943
2944         * rendering/RenderGrid.cpp:
2945         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2946         (WebCore::GridItemWithSpan::GridItemWithSpan):
2947         (WebCore::GridItemWithSpan::span):
2948         (WebCore::GridItemWithSpan::operator<):
2949         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
2950         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2951         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2952         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2953         (WebCore::RenderGrid::cachedGridSpan):
2954         (WebCore::RenderGrid::gridAreaBreadthForChild):
2955         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
2956         (WebCore::RenderGrid::columnAxisOffsetForChild):
2957         (WebCore::RenderGrid::rowAxisOffsetForChild):
2958         (WebCore::GridItemWithSpan::gridItem): Deleted.
2959         (WebCore::RenderGrid::populateGridPositions): Deleted.
2960         * rendering/RenderGrid.h:
2961
2962 2015-11-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2963
2964         JS Built-ins functions should be able to assert
2965         https://bugs.webkit.org/show_bug.cgi?id=150333
2966
2967         Reviewed by Yusuke Suzuki.
2968
2969         * Modules/streams/ReadableStreamInternals.js:
2970         (privateInitializeReadableStreamReader): Activating an @assert.
2971
2972 2015-11-02  Sergio Villar Senin  <svillar@igalia.com>
2973
2974         [css-grid] Improve grid container sizing with size constraints and intrinsic sizes
2975         https://bugs.webkit.org/show_bug.cgi?id=150679
2976
2977         Reviewed by Darin Adler.
2978
2979         The grid container stores from now on its min-content and
2980         max-content block sizes in order to be able to properly
2981         compute its intrinsic size. It has to redefine
2982         computeIntrinsicLogicalContentHeightUsing() because the
2983         behavior of grid is different to "normal" blocks:
2984
2985         - the min-content size is the sum of the grid container's
2986         track sizes in the appropiate axis when the grid is sized
2987         under a min-content constraint.
2988         - the max-content size is the sum of the grid container's
2989         track sizes in the appropiate axis when the grid is sized
2990         under a max-content constraint.
2991         - the auto block size is the max-content size.
2992
2993         A nice side effect is that we can now properly detect whether
2994         the grid has a definite size on a given axis or not.
2995
2996         Tests: fast/css-grid-layout/absolute-positioning-definite-sizes.html
2997                fast/css-grid-layout/flex-and-intrinsic-sizes.html
2998                fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
2999                fast/css-grid-layout/maximize-tracks-definite-indefinite-width.html
3000
3001         * rendering/RenderBox.h: made
3002         computeIntrinsicLogicalContentHeightUsing() virtual.
3003         * rendering/RenderGrid.cpp:
3004         (WebCore::RenderGrid::GridSizingData::GridSizingData):
3005         (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection):
3006         (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection):
3007         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
3008         (WebCore::RenderGrid::computeTrackSizesForDirection):
3009         (WebCore::RenderGrid::layoutBlock):
3010         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
3011         (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
3012         (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
3013         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3014         (WebCore::RenderGrid::distributeSpaceToTracks):
3015         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
3016         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
3017         (WebCore::RenderGrid::layoutGridItems):
3018         (WebCore::RenderGrid::populateGridPositions):
3019         (WebCore::RenderGrid::gridElementIsShrinkToFit): Deleted.
3020         * rendering/RenderGrid.h:
3021
3022 2015-11-05  Sergio Villar Senin  <svillar@igalia.com>
3023
3024         [css-grid] Grid placement conflict handling
3025         https://bugs.webkit.org/show_bug.cgi?id=150891
3026
3027         Reviewed by Darin Adler.
3028
3029         If the placement for a grid item contains two lines, and the
3030         start line is further end-ward than the end line, swap the two
3031         lines. If the start line is equal to the end line, remove the
3032         end line.
3033
3034         Test: fast/css-grid-layout/swap-lines-if-start-is-further-endward-than-end-line.html
3035
3036         * rendering/style/GridResolvedPosition.cpp:
3037         (WebCore::resolveNamedGridLinePositionFromStyle):
3038         (WebCore::resolveGridPositionFromStyle):
3039         (WebCore::GridResolvedPosition::GridResolvedPosition):
3040         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
3041         (WebCore::adjustGridPositionForSide): Deleted.
3042         * rendering/style/GridResolvedPosition.h:
3043         (WebCore::GridResolvedPosition::prev):
3044
3045 2015-11-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3046
3047         [EFL] Add UserAgentEFl.cpp|h
3048         https://bugs.webkit.org/show_bug.cgi?id=151007
3049
3050         Reviewed by Darin Adler.
3051
3052         As other ports EFL port starts to have UserAgentEfl class in order to support more detailed
3053         UA.
3054
3055         No new tests, no behavior change.
3056
3057         * PlatformEfl.cmake:
3058         * platform/efl/UserAgentEfl.cpp: Added.
3059         (WebCore::platformForUAString):
3060         (WebCore::platformVersionForUAString):
3061         (WebCore::versionForUAString):
3062         (WebCore::standardUserAgent):
3063         * platform/efl/UserAgentEfl.h: Added.
3064
3065 2015-11-08  David Kilzer  <ddkilzer@apple.com>
3066
3067         REGRESSION (r192140): Windows build broke after removing ColorSpace argument to all drawing calls
3068         <http://webkit.org/b/150967>
3069
3070         Unreviewed attempt to fix the Windows build.
3071
3072         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3073         (PlatformCALayerWin::drawTextAtPoint):
3074         * platform/graphics/win/ImageCGWin.cpp:
3075         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3076         * rendering/RenderThemeWin.cpp:
3077         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
3078         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
3079         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
3080
3081 2015-11-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3082
3083         generate-js-builtins.js should support @internal annotation
3084         https://bugs.webkit.org/show_bug.cgi?id=150929
3085
3086         Reviewed by Darin Adler.
3087
3088         No change in behavior.
3089
3090         * Modules/streams/ReadableStreamInternals.js: Renamed @internals to @internal.
3091         * Modules/streams/StreamInternals.js: Ditto.
3092         * Modules/streams/WritableStreamInternals.js: Ditto.
3093
3094 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
3095
3096         Remove ColorSpace argument to all the drawing calls
3097         https://bugs.webkit.org/show_bug.cgi?id=150967
3098
3099         Reviewed by Darin Adler.
3100
3101         Since the -webkit-color-correction CSS property was removed in r188202, and ColorSpaceDeviceRGB
3102         and ColorSpaceSRGB are functionally equivalent, we can remove all the ColorSpace arguments passed
3103         to drawing functions, and remove RenderStyle::colorSpace(), which was hardcoded to return ColorSpaceSRGB.
3104         
3105         Fill and stroke ColorSpaces are also remove from graphics state, simplifying color save/restore.
3106         
3107         * bindings/scripts/CodeGeneratorObjC.pm:
3108         (GenerateImplementation):
3109         * css/CSSFilterImageValue.cpp:
3110         (WebCore::CSSFilterImageValue::image):
3111         * editing/FrameSelection.cpp:
3112         (WebCore::CaretBase::paintCaret):
3113         * editing/cocoa/HTMLConverter.mm:
3114         (_platformColor):
3115         * html/HTMLCanvasElement.cpp:
3116         (WebCore::HTMLCanvasElement::paint):
3117         * html/canvas/CanvasRenderingContext2D.cpp:
3118         (WebCore::CanvasRenderingContext2D::clearRect):
3119         (WebCore::CanvasRenderingContext2D::applyShadow):
3120         (WebCore::CanvasRenderingContext2D::drawImage):
3121         (WebCore::CanvasRenderingContext2D::compositeBuffer):
3122         (WebCore::drawImageToContext):
3123         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedDrawImage):
3124         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3125         * html/canvas/CanvasRenderingContext2D.h:
3126         * html/canvas/CanvasStyle.cpp:
3127         (WebCore::CanvasStyle::applyStrokeColor):
3128         (WebCore::CanvasStyle::applyFillColor):
3129         * html/canvas/WebGLRenderingContextBase.cpp:
3130         (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
3131         * page/DebugPageOverlays.cpp:
3132         (WebCore::RegionOverlay::drawRect):
3133         * page/FrameView.cpp:
3134         (WebCore::FrameView::paintScrollCorner):
3135         (WebCore::FrameView::paintScrollbar):
3136         (WebCore::FrameView::paintContents):
3137         * page/PrintContext.cpp:
3138         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
3139         * platform/ScrollView.cpp:
3140         (WebCore::ScrollView::paintPanScrollIcon):
3141         * platform/ScrollbarTheme.h:
3142         (WebCore::ScrollbarTheme::defaultPaintScrollCorner):
3143         * platform/ScrollbarThemeComposite.cpp:
3144         (WebCore::ScrollbarThemeComposite::paintScrollCorner):
3145         (WebCore::ScrollbarThemeComposite::paintOverhangAreas):
3146         * platform/Theme.cpp:
3147         (WebCore::Theme::drawNamedImage):
3148         * platform/cocoa/ThemeCocoa.cpp:
3149         (WebCore::ThemeCocoa::drawNamedImage):
3150         * platform/graphics/BitmapImage.cpp:
3151         (WebCore::BitmapImage::drawPattern):
3152         * platform/graphics/BitmapImage.h:
3153         * platform/graphics/Color.h:
3154         * platform/graphics/CrossfadeGeneratedImage.cpp:
3155         (WebCore::drawCrossfadeSubimage):
3156         (WebCore::CrossfadeGeneratedImage::draw):
3157         (WebCore::CrossfadeGeneratedImage::drawPattern):
3158         * platform/graphics/CrossfadeGeneratedImage.h:
3159         * platform/graphics/GeneratedImage.h:
3160         * platform/graphics/GradientImage.cpp:
3161         (WebCore::GradientImage::draw):
3162         (WebCore::GradientImage::drawPattern):
3163         * platform/graphics/GradientImage.h:
3164         * platform/graphics/GraphicsContext.cpp:
3165         (WebCore::GraphicsContext::drawRaisedEllipse):
3166         (WebCore::GraphicsContext::setStrokeColor):
3167         (WebCore::GraphicsContext::setShadow):
3168         (WebCore::GraphicsContext::setLegacyShadow):
3169         (WebCore::GraphicsContext::getShadow):
3170         (WebCore::GraphicsContext::setFillColor):
3171         (WebCore::GraphicsContext::drawImage):
3172         (WebCore::GraphicsContext::drawTiledImage):
3173         (WebCore::GraphicsContext::drawImageBuffer):
3174         (WebCore::GraphicsContext::fillRect):
3175         (WebCore::GraphicsContext::fillRoundedRect):
3176         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3177         (WebCore::GraphicsContext::clearShadow): Deleted.
3178         * platform/graphics/GraphicsContext.h:
3179         (WebCore::GraphicsContext::strokeColorSpace): Deleted.
3180         (WebCore::GraphicsContext::fillColorSpace): Deleted.
3181         * platform/graphics/Image.cpp:
3182         (WebCore::Image::fillWithSolidColor):
3183         (WebCore::Image::drawTiled):
3184         * platform/graphics/Image.h:
3185         (WebCore::Image::drawFrameMatchingSourceSize):
3186         * platform/graphics/ImageBuffer.h:
3187         (WebCore::ImageBuffer::create):
3188         * platform/graphics/NamedImageGeneratedImage.cpp:
3189         (WebCore::NamedImageGeneratedImage::draw):
3190         (WebCore::NamedImageGeneratedImage::drawPattern):
3191         * platform/graphics/NamedImageGeneratedImage.h:
3192         * platform/graphics/ShadowBlur.cpp:
3193         (WebCore::ScratchBuffer::setCachedShadowValues):
3194         (WebCore::ScratchBuffer::setCachedInsetShadowValues):
3195         (WebCore::ShadowBlur::ShadowBlur):
3196         (WebCore::ShadowBlur::setShadowValues):
3197         (WebCore::ShadowBlur::drawShadowBuffer):
3198         (WebCore::ShadowBlur::drawRectShadowWithoutTiling):
3199         (WebCore::ShadowBlur::drawInsetShadowWithoutTiling):
3200         (WebCore::ShadowBlur::drawInsetShadowWithTiling):
3201         (WebCore::ShadowBlur::drawRectShadowWithTiling):
3202         (WebCore::ShadowBlur::drawLayerPieces):
3203         (WebCore::ShadowBlur::blurAndColorShadowBuffer):
3204         (WebCore::ShadowBlur::beginShadowLayer):
3205         (WebCore::ShadowBlur::endShadowLayer):
3206         * platform/graphics/ShadowBlur.h:
3207         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3208         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
3209         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3210         * platform/graphics/ca/GraphicsLayerCA.cpp:
3211         (WebCore::GraphicsLayerCA::setContentsToImage): Deleted.
3212         * platform/graphics/ca/TileGrid.cpp:
3213         (WebCore::TileGrid::platformCALayerPaintContents):
3214         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3215         (PlatformCALayerWinInternal::drawRepaintCounters):
3216         * platform/graphics/cairo/BitmapImageCairo.cpp:
3217         (WebCore::BitmapImage::draw):
3218         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3219         (WebCore::GraphicsContext::fillRect):
3220         (WebCore::GraphicsContext::setPlatformFillColor):
3221         (WebCore::GraphicsContext::setPlatformStrokeColor):
3222         (WebCore::GraphicsContext::setPlatformShadow):
3223         (WebCore::GraphicsContext::platformFillRoundedRect):
3224         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3225         (WebCore::GraphicsContext::drawPattern):
3226         * platform/graphics/cairo/ImageBufferCairo.cpp:
3227         (WebCore::ImageBuffer::draw):
3228         (WebCore::ImageBuffer::drawPattern):
3229         * platform/graphics/cairo/ImageCairo.cpp:
3230         (WebCore::Image::drawPattern):
3231         * platform/graphics/cg/BitmapImageCG.cpp:
3232         (WebCore::BitmapImage::draw):
3233         * platform/graphics/cg/ColorCG.cpp:
3234         (WebCore::leakCGColor):
3235         (WebCore::cachedCGColor):
3236         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3237         (WebCore::GraphicsContext3D::paintToCanvas):
3238         * platform/graphics/cg/GraphicsContextCG.cpp:
3239         (WebCore::setCGFillColor):
3240         (WebCore::setCGStrokeColor):
3241         (WebCore::GraphicsContext::platformInit):
3242         (WebCore::GraphicsContext::drawNativeImage):
3243         (WebCore::GraphicsContext::drawPattern):
3244         (WebCore::GraphicsContext::drawRect):
3245         (WebCore::GraphicsContext::drawLine):
3246         (WebCore::GraphicsContext::applyFillPattern):
3247         (WebCore::GraphicsContext::fillRect):
3248         (WebCore::GraphicsContext::platformFillRoundedRect):
3249         (WebCore::GraphicsContext::fillRectWithRoundedHole):
3250         (WebCore::GraphicsContext::setPlatformShadow):
3251         (WebCore::GraphicsContext::drawLinesForText):
3252         (WebCore::GraphicsContext::setPlatformStrokeColor):
3253         (WebCore::GraphicsContext::setPlatformFillColor):
3254         (WebCore::sRGBColorSpaceRef): Deleted.
3255         * platform/graphics/cg/ImageBufferCG.cpp:
3256         (WebCore::ImageBuffer::copyImage):
3257         (WebCore::ImageBuffer::draw):
3258         (WebCore::ImageBuffer::drawPattern):
3259         * platform/graphics/cg/ImageCG.cpp:
3260         (WebCore::Image::drawPattern):
3261         (WebCore::Image::imageWithColorSpace): Deleted.
3262         * platform/graphics/cg/PDFDocumentImage.cpp:
3263         (WebCore::PDFDocumentImage::draw):
3264         * platform/graphics/cg/PDFDocumentImage.h:
3265         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3266         (WebCore::FontCascade::drawGlyphs):
3267         * platform/graphics/filters/FEBlend.cpp:
3268         (WebCore::FEBlend::platformApplySoftware):
3269         * platform/graphics/filters/FEColorMatrix.cpp:
3270         (WebCore::FEColorMatrix::platformApplySoftware):
3271         * platform/graphics/filters/FEComposite.cpp:
3272         (WebCore::FEComposite::platformApplySoftware):
3273         * platform/graphics/filters/FEDropShadow.cpp:
3274         (WebCore::FEDropShadow::platformApplySoftware):
3275         * platform/graphics/filters/FEFlood.cpp:
3276         (WebCore::FEFlood::platformApplySoftware):
3277         * platform/graphics/filters/FEMerge.cpp:
3278         (WebCore::FEMerge::platformApplySoftware):
3279         * platform/graphics/filters/FEOffset.cpp:
3280         (WebCore::FEOffset::platformApplySoftware):
3281         * platform/graphics/filters/FETile.cpp:
3282         (WebCore::FETile::platformApplySoftware):
3283         * platform/graphics/filters/SourceAlpha.cpp:
3284         (WebCore::SourceAlpha::platformApplySoftware):
3285         * platform/graphics/filters/SourceGraphic.cpp:
3286         (WebCore::SourceGraphic::platformApplySoftware):
3287         * platform/graphics/ios/IconIOS.mm:
3288         (WebCore::Icon::paint):
3289         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
3290         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp:
3291         * platform/graphics/win/FontCGWin.cpp:
3292         (WebCore::FontCascade::drawGlyphs):
3293         * platform/graphics/win/GraphicsContextCGWin.cpp:
3294         (WebCore::GraphicsContext::drawFocusRing):
3295         * platform/graphics/win/ImageCGWin.cpp:
3296         (WebCore::BitmapImage::getHBITMAPOfSize):
3297         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3298         * platform/graphics/win/ImageCairoWin.cpp:
3299         (WebCore::BitmapImage::getHBITMAPOfSize):
3300         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
3301         * platform/ios/LegacyTileCache.mm:
3302         (WebCore::LegacyTileCache::drawLayer):
3303         * platform/ios/LegacyTileGridTile.mm:
3304         (WebCore::LegacyTileGridTile::showBorder):
3305         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3306         (WebVideoFullscreenControllerContext::didSetupFullscreen):
3307         * platform/mac/DragImageMac.mm:
3308         (WebCore::drawAtPoint):
3309         * platform/mac/ScrollbarThemeMac.mm:
3310         (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground):
3311         * platform/mac/ThemeMac.mm:
3312         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
3313         * platform/mediastream/MediaStreamPrivate.cpp:
3314         (WebCore::MediaStreamPrivate::paintCurrentFrameInContext):
3315         * platform/mock/ScrollbarThemeMock.cpp:
3316         (WebCore::ScrollbarThemeMock::paintTrackBackground):
3317         (WebCore::ScrollbarThemeMock::paintThumb):
3318         * platform/win/DragImageWin.cpp:
3319         (WebCore::createDragImageForLink):
3320         * platform/win/PopupMenuWin.cpp:
3321         (WebCore::PopupMenuWin::paint):
3322         * platform/win/WebCoreTextRenderer.cpp:
3323         (WebCore::doDrawTextAtPoint):
3324         * rendering/EllipsisBox.cpp:
3325         (WebCore::EllipsisBox::paint):
3326         (WebCore::EllipsisBox::paintSelection):
3327         * rendering/FilterEffectRenderer.cpp:
3328         (WebCore::FilterEffectRendererHelper::applyFilterEffect):
3329         * rendering/InlineTextBox.cpp:
3330         (WebCore::InlineTextBox::paintSelection):
3331         (WebCore::InlineTextBox::paintCompositionBackground):
3332         (WebCore::InlineTextBox::paintDecoration):
3333         (WebCore::InlineTextBox::paintTextMatchMarker):
3334         (WebCore::InlineTextBox::paintCompositionUnderline):
3335         * rendering/RenderBlock.cpp:
3336         (WebCore::RenderBlock::blockSelectionGap):
3337         (WebCore::RenderBlock::logicalLeftSelectionGap):
3338         (WebCore::RenderBlock::logicalRightSelectionGap):
3339         * rendering/RenderBox.cpp:
3340         (WebCore::RenderBox::paintClippingMask):
3341         * rendering/RenderBoxModelObject.cpp:
3342         (WebCore::applyBoxShadowForBackground):
3343         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3344         (WebCore::RenderBoxModelObject::paintBorder):
3345         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
3346         (WebCore::RenderBoxModelObject::paintBoxShadow):
3347         * rendering/RenderDetailsMarker.cpp:
3348         (WebCore::RenderDetailsMarker::paint):
3349         * rendering/RenderElement.cpp:
3350         (WebCore::RenderElement::drawLineForBoxSide):
3351         (WebCore::RenderElement::paintOutline):
3352         * rendering/RenderEmbeddedObject.cpp:
3353         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
3354         (WebCore::RenderEmbeddedObject::paintReplaced):
3355         * rendering/RenderFileUploadControl.cpp:
3356         (WebCore::RenderFileUploadControl::paintObject):
3357         * rendering/RenderFrameSet.cpp:
3358         (WebCore::RenderFrameSet::paintColumnBorder):
3359         (WebCore::RenderFrameSet::paintRowBorder):
3360         * rendering/RenderImage.cpp:
3361         (WebCore::RenderImage::paintReplaced):
3362         (WebCore::RenderImage::paintIntoRect):
3363         * rendering/RenderLayer.cpp:
3364         (WebCore::RenderLayer::beginTransparencyLayers):
3365         (WebCore::RenderLayer::paintScrollCorner):
3366         (WebCore::RenderLayer::drawPlatformResizerImage):
3367         (WebCore::RenderLayer::paintResizer):
3368         * rendering/RenderListBox.cpp:
3369         (WebCore::RenderListBox::paintItemForeground):
3370         (WebCore::RenderListBox::paintItemBackground):
3371         * rendering/RenderListMarker.cpp:
3372         (WebCore::RenderListMarker::paint):
3373         * rendering/RenderReplaced.cpp:
3374         (WebCore::RenderReplaced::paint):
3375         * rendering/RenderScrollbarTheme.cpp:
3376         (WebCore::RenderScrollbarTheme::paintScrollCorner):
3377         * rendering/RenderSnapshottedPlugIn.cpp:
3378         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
3379         * rendering/RenderTheme.cpp:
3380         (WebCore::RenderTheme::paintSliderTicks):
3381         * rendering/RenderThemeIOS.mm:
3382         (WebCore::drawAxialGradient):
3383         (WebCore::drawRadialGradient):
3384         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3385         (WebCore::RenderThemeIOS::paintRadioDecorations):
3386         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
3387         (WebCore::RenderThemeIOS::paintSliderTrack):
3388         (WebCore::RenderThemeIOS::paintProgressBar):
3389         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
3390         * rendering/RenderThemeMac.mm:
3391         (WebCore::RenderThemeMac::paintProgressBar):
3392         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
3393         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
3394         (WebCore::titleTextColorForAttachment):
3395         (WebCore::AttachmentLayout::layOutSubtitle):
3396         (WebCore::paintAttachmentIconBackground):
3397         (WebCore::paintAttachmentTitleBackground):
3398         (WebCore::paintAttachmentProgress):
3399         * rendering/RenderView.cpp:
3400         (WebCore::RenderView::paint):
3401         (WebCore::RenderView::paintBoxDecorations):
3402         * rendering/RenderWidget.cpp:
3403         (WebCore::RenderWidget::paint):
3404         * rendering/RootInlineBox.cpp:
3405         (WebCore::RootInlineBox::lineSelectionGap):
3406         * rendering/SimpleLineLayoutFunctions.cpp:
3407         (WebCore::SimpleLineLayout::paintDebugBorders):
3408         * rendering/TextPaintStyle.cpp:
3409         (WebCore::TextPaintStyle::TextPaintStyle):
3410         (WebCore::adjustColorForVisibilityOnBackground):
3411         (WebCore::computeTextPaintStyle):
3412         (WebCore::updateGraphicsContext):
3413         * rendering/TextPaintStyle.h:
3414         (WebCore::TextPaintStyle::TextPaintStyle):
3415         * rendering/TextPainter.cpp:
3416         (WebCore::ShadowApplier::ShadowApplier):
3417         (WebCore::paintTextWithShadows):
3418         * rendering/mathml/RenderMathMLBlock.cpp:
3419         (WebCore::RenderMathMLBlock::paint):
3420         * rendering/mathml/RenderMathMLFraction.cpp:
3421         (WebCore::RenderMathMLFraction::paint):
3422         * rendering/mathml/RenderMathMLMenclose.cpp:
3423         (WebCore::RenderMathMLMenclose::paint):
3424         * rendering/mathml/RenderMathMLOperator.cpp:
3425         (WebCore::RenderMathMLOperator::paint):
3426         * rendering/mathml/RenderMathMLRadicalOperator.cpp:
3427         (WebCore::RenderMathMLRadicalOperator::paint):
3428         * rendering/mathml/RenderMathMLRoot.cpp:
3429         (WebCore::RenderMathMLRoot::paint):
3430         * rendering/shapes/Shape.cpp:
3431         (WebCore::Shape::createRasterShape):
3432         * rendering/style/NinePieceImage.cpp:
3433         (WebCore::NinePieceImage::paint):
3434         * rendering/style/RenderStyle.h:
3435         * rendering/svg/RenderSVGImage.cpp:
3436         (WebCore::RenderSVGImage::paintForeground):
3437         * rendering/svg/RenderSVGPath.cpp:
3438         (WebCore::useStrokeStyleToFill):
3439         * rendering/svg/RenderSVGResourceFilter.cpp:
3440         (WebCore::RenderSVGResourceFilter::postApplyResource):
3441         * rendering/svg/RenderSVGResourceSolidColor.cpp:
3442         (WebCore::RenderSVGResourceSolidColor::applyResource):
3443         * rendering/svg/SVGInlineTextBox.cpp:
3444         (WebCore::SVGInlineTextBox::paintSelectionBackground):
3445         * rendering/svg/SVGRenderingContext.cpp:
3446         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
3447         (WebCore::SVGRenderingContext::bufferForeground):
3448         * svg/SVGAnimatedColor.cpp:
3449         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
3450         * svg/graphics/SVGImage.cpp:
3451         (WebCore::SVGImage::drawForContainer):
3452         (WebCore::SVGImage::nativeImageForCurrentFrame):
3453         (WebCore::SVGImage::drawPatternForContainer):
3454         (WebCore::SVGImage::draw):
3455         * svg/graphics/SVGImage.h:
3456         * svg/graphics/SVGImageForContainer.cpp:
3457         (WebCore::SVGImageForContainer::draw):
3458         (WebCore::SVGImageForContainer::drawPattern):
3459         * svg/graphics/SVGImageForContainer.h:
3460         * svg/graphics/filters/SVGFEImage.cpp:
3461         (WebCore::FEImage::platformApplySoftware):
3462         * testing/MockPageOverlayClient.cpp:
3463         (WebCore::MockPageOverlayClient::drawRect):
3464
3465 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
3466
3467         Use ColorSpaceSRGB for image buffers everywhere
3468         https://bugs.webkit.org/show_bug.cgi?id=150990
3469
3470         Reviewed by Zalan Bujtas.
3471
3472         ColorSpaceSRGB and ColorSpaceDeviceRGB are equivalent now, so convert
3473         code that creates image buffers tagged with ColorSpaceDeviceRGB to use ColorSpaceSRGB.
3474
3475         * platform/graphics/GraphicsContext.cpp:
3476         (WebCore::GraphicsContext::createCompatibleBuffer):
3477         * platform/graphics/ImageBuffer.h:
3478         (WebCore::ImageBuffer::create):
3479         * platform/graphics/cg/BitmapImageCG.cpp:
3480         (WebCore::BitmapImage::checkForSolidColor):
3481         * platform/graphics/cg/ColorCG.cpp:
3482         (WebCore::Color::Color):
3483         * platform/graphics/cg/GraphicsContextCG.cpp:
3484         (WebCore::sRGBColorSpaceRef): Deleted.
3485         * platform/graphics/cg/ImageBufferCG.cpp:
3486         (WebCore::ImageBuffer::putByteArray):
3487         * platform/graphics/cocoa/IOSurface.mm:
3488         (IOSurface::createFromImage):
3489         * platform/graphics/filters/FEFlood.h:
3490         * platform/graphics/filters/FETile.cpp:
3491         (WebCore::FETile::platformApplySoftware):
3492         * platform/graphics/filters/FilterEffect.cpp:
3493         (WebCore::FilterEffect::FilterEffect):
3494         * platform/graphics/filters/SourceGraphic.h:
3495         (WebCore::SourceGraphic::SourceGraphic):
3496         * rendering/FilterEffectRenderer.cpp:
3497         (WebCore::FilterEffectRenderer::build):
3498         (WebCore::FilterEffectRenderer::apply):
3499         * rendering/RenderThemeMac.mm:
3500         (WebCore::RenderThemeMac::paintProgressBar):
3501         * rendering/svg/RenderSVGResourceClipper.cpp:
3502         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
3503         * rendering/svg/RenderSVGResourceFilter.cpp:
3504         (WebCore::RenderSVGResourceFilter::buildPrimitives):
3505         * rendering/svg/RenderSVGResourceGradient.cpp:
3506         (WebCore::createMaskAndSwapContextForTextGradient):
3507         * rendering/svg/RenderSVGResourceMasker.cpp:
3508         (WebCore::RenderSVGResourceMasker::applyResource):
3509         * rendering/svg/RenderSVGResourcePattern.cpp:
3510         (WebCore::RenderSVGResourcePattern::createTileImage):
3511         * svg/graphics/SVGImage.cpp:
3512         (WebCore::SVGImage::drawPatternForContainer):
3513         * svg/graphics/filters/SVGFEImage.cpp:
3514         (WebCore::FEImage::platformApplySoftware):
3515
3516 2015-11-07  Zalan Bujtas  <zalan@apple.com>
3517
3518         Crash when subtree layout is set on FrameView while auto size mode is enabled.
3519         https://bugs.webkit.org/show_bug.cgi?id=150995
3520         rdar://problem/22785262
3521
3522         Reviewed by Beth Dakin.
3523
3524         Autosizing initiates multiple synchronous layouts to calculate preferred view width for current content.
3525         FrameView::autoSizeIfEnabled() is called from FrameView::layout() while we are in InPreLayout state.
3526         It is safe to do during full layout.
3527         However, since we setup the subtree state just before the autoSizeIfEnabled() call, reentering it with
3528         a newly issued layout confuses SubtreeLayoutStateMaintainer.
3529
3530         This patch reverses the order of autoSizeIfEnabled() call and the subtree layout state setup.
3531         It also ensures that the first layout requested by autoSizeIfEnabled() always runs on the whole tree.  
3532
3533         Test: fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html
3534
3535         * page/FrameView.cpp:
3536         (WebCore::FrameView::layout):
3537         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
3538         (WebCore::FrameView::scheduleRelayout):
3539         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3540         (WebCore::FrameView::autoSizeIfEnabled):
3541         * page/FrameView.h:
3542         * testing/Internals.cpp:
3543         (WebCore::Internals::enableAutoSizeMode):
3544         * testing/Internals.h:
3545         * testing/Internals.idl:
3546
3547 2015-11-07  Chris Dumez  <cdumez@apple.com>
3548
3549         embed element without src and type attributes should represent nothing
3550         https://bugs.webkit.org/show_bug.cgi?id=148853
3551         <rdar://problem/22588235>
3552
3553         Reviewed by Zalan Bujtas.
3554
3555         As per the HTML specification, an embed element without src and type
3556         attributes should represent nothing:
3557         https://html.spec.whatwg.org/multipage/embedded-content.html#the-embed-element
3558
3559         This patch fixes the issue by making sure we don't construct a
3560         renderer for such embed elements.
3561
3562         The new behavior is consistent with Firefox but differs from Chrome.
3563
3564         No new tests, already covered by existing tests.
3565
3566         * html/HTMLEmbedElement.cpp:
3567         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3568
3569 2015-11-07  Michael Catanzaro  <mcatanzaro@igalia.com>
3570
3571         Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code
3572         https://bugs.webkit.org/show_bug.cgi?id=150996
3573
3574         Reviewed by Andreas Kling.
3575
3576         Remove ASSERT(this) statement that is triggering hundreds of warnings from Clang.
3577
3578         * dom/Node.h:
3579         (WebCore::Node::document):
3580
3581 2015-11-07  Michael Catanzaro  <mcatanzaro@igalia.com>
3582
3583         Unreviewed, fix GTK build after r191981
3584
3585         * html/HTMLFormControlElement.cpp:
3586
3587 2015-11-06  Scott Valentine  <svalentine@ikayzo.com>
3588
3589         Allow an optional hash algorithm to be passed to generateKey for RSA keys.
3590         https://bugs.webkit.org/show_bug.cgi?id=144938
3591
3592         Reviewed by Alexey Proskuryakov.
3593
3594         Test: crypto/subtle/rsa-export-generated-keys.html
3595
3596         This changeset allows an optional hash parameter to be passed to the generate
3597         key function for RSA type keys. Previously, there was no way to export generated
3598         keys, as no hash function could be associated with the key (required for JWK).
3599
3600         The current WebCrypto API draft requires the hash function to be specified in the
3601         algorithm object passed to generateKey (http://www.w3.org/TR/WebCryptoAPI 20.4),
3602         however, they were made optional in this implementation to maintain compatiblity.
3603
3604         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3605         (WebCore::getHashAlgorithm):
3606         (WebCore::createHmacParams):
3607         (WebCore::createHmacKeyParams):
3608         (WebCore::createRsaKeyGenParams):
3609         (WebCore::createRsaOaepParams):
3610         (WebCore::createRsaSsaParams):
3611         (WebCore::JSCryptoAlgorithmDictionary::createParametersForImportKey): Deleted.
3612         * bindings/js/SerializedScriptValue.cpp:
3613         (WebCore::CloneDeserializer::readRSAKey):
3614         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3615         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
3616         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3617         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3618         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
3619         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3620         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3621         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
3622         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3623         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
3624         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
3625         (WebCore::CryptoKeyRSA::create):
3626         (WebCore::CryptoKeyRSA::generatePair):
3627         (WebCore::CryptoKeyRSA::restrictToHash): Deleted.
3628         * crypto/keys/CryptoKeyRSA.h:
3629         * crypto/mac/CryptoKeyRSAMac.cpp:
3630         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
3631         (WebCore::CryptoKeyRSA::create):
3632         (WebCore::CryptoKeyRSA::generatePair):
3633         (WebCore::CryptoKeyRSA::restrictToHash): Deleted.
3634         * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
3635
3636 2015-11-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3637
3638         Scrolling iframe inside scrollable div does not work with trackpad
3639         https://bugs.webkit.org/show_bug.cgi?id=150168
3640         <rdar://problem/23143931>
3641
3642         Reviewed by Brent Fulgham.
3643
3644         When scrolling in an iframe nested under an overflow scrolling region, EventHandler::platformPrepareForWheelEvents
3645         fails to compute the correct scrollableArea, using the overflow div's scrollable area instead of the iframe's view.
3646         This causes the latching algorithm to bail out of handling the wheel event. To avoid this, we special-case the
3647         decision to compute the scrollableArea from the scrollableContainer if we are attempting to scroll in an iframe.
3648
3649         Test: fast/scrolling/latching/scroll-iframe-in-overflow.html
3650
3651         * page/mac/EventHandlerMac.mm:
3652         (WebCore::EventHandler::platformPrepareForWheelEvents):
3653
3654 2015-11-06  Brady Eidson  <beidson@apple.com>
3655
3656         Modern IDB: Make the result data for a "get" request be an IDBGetResult.
3657         https://bugs.webkit.org/show_bug.cgi?id=150985
3658
3659         Reviewed by Alex Christensen.
3660
3661         No new tests (Refactor, no change in behavior).
3662
3663         * Modules/indexeddb/IDBGetResult.h:
3664         (WebCore::IDBGetResult::IDBGetResult):
3665         (WebCore::IDBGetResult::dataFromBuffer):
3666         (WebCore::IDBGetResult::isolatedCopy):
3667         
3668         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3669         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
3670         
3671         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
3672         (WebCore::GetOperation::perform):
3673         
3674         * Modules/indexeddb/server/IDBBackingStore.h:
3675         
3676         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3677         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
3678         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3679         
3680         * Modules/indexeddb/server/MemoryIndex.cpp:
3681         (WebCore::IDBServer::MemoryIndex::valueForKeyRange):
3682         * Modules/indexeddb/server/MemoryIndex.h:
3683         
3684         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3685         (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
3686         * Modules/indexeddb/server/MemoryObjectStore.h:
3687         
3688         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3689         (WebCore::IDBServer::UniqueIDBDatabase::storeCallback):
3690         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
3691         (WebCore::IDBServer::UniqueIDBDatabase::performGetIndexRecord):
3692         (WebCore::IDBServer::UniqueIDBDatabase::didPerformGetRecord):
3693         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
3694         (WebCore::IDBServer::UniqueIDBDatabase::performValueDataCallback): Deleted.
3695         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3696         
3697         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3698         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
3699         
3700         * Modules/indexeddb/shared/IDBResultData.cpp:
3701         (WebCore::IDBResultData::IDBResultData):
3702         (WebCore::IDBResultData::getRecordSuccess):
3703         (WebCore::IDBResultData::getResult):
3704         * Modules/indexeddb/shared/IDBResultData.h:
3705         (WebCore::IDBResultData::resultData): Deleted.
3706
3707 2015-11-06  Chris Dumez  <cdumez@apple.com>
3708
3709         Remove unused HTMLFormControlsCollection::namedItem()
3710         https://bugs.webkit.org/show_bug.cgi?id=150975
3711
3712         Reviewed by Andreas Kling.
3713
3714         Remove unused HTMLFormControlsCollection::namedItem().
3715         JSHTMLFormControlsCollection::namedItem() calls namedItems() on the
3716         implementation object, not namedItem() because it returns a
3717         RadioNodeList when there are several matches.
3718
3719         * html/HTMLFormControlsCollection.cpp:
3720         (WebCore::firstNamedItem): Deleted.
3721         (WebCore::HTMLFormControlsCollection::namedItem): Deleted.
3722         * html/HTMLFormControlsCollection.h:
3723
3724 2015-11-06  Myles C. Maxfield  <mmaxfield@apple.com>
3725
3726         REGRESSION(r182286): Tatechuyoko following ruby is drawn too far to the right
3727         https://bugs.webkit.org/show_bug.cgi?id=150923
3728
3729         Reviewed by Zalan Bujtas.
3730
3731         Ever since r182286, expansion opportunities in justified ruby were moved to their neighboring
3732         elements (thereby forbidding trailing nor leading expansions inside ruby). However, when the
3733         neighboring element is tatechuyoko, we will erroneously honor the expansion opportunity inside
3734         the tatechuyoko, thereby moving it horizontally.
3735
3736         Tatechuyoko should never have expansion opportunities inside it.
3737
3738         Test: fast/text/ruby-justify-tatechuyoko.html
3739
3740         * rendering/RenderBlockLineLayout.cpp:
3741         (WebCore::expansionBehaviorForInlineTextBox):
3742
3743 2015-11-06  Mario Sanchez Prada  <mario@endlessm.com>
3744
3745         Layout Test accessibility/win/linked-elements.html is crashing on win debug
3746         https://bugs.webkit.org/show_bug.cgi?id=150944
3747
3748         Reviewed by Chris Fleizach.
3749
3750         Be more precise ASSERTing on textUnderElement, only checking that the render
3751         tree is stable before using TextIteraror when in 'IncludeAllChildren' mode.
3752
3753         * accessibility/AccessibilityRenderObject.cpp:
3754         (WebCore::AccessibilityRenderObject::textUnderElement):
3755
3756 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3757
3758         [GStreamer] Use MainThreadNotifier to send notifications to main thread in WebKitWebSourceGStreamer
3759         https://bugs.webkit.org/show_bug.cgi?id=150890
3760
3761         Reviewed by Žan Doberšek.
3762
3763         Instead of the GThreadSafeMainLoopSources.
3764
3765         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3766         (webKitWebSrcStop):
3767         (webKitWebSrcChangeState):
3768         (webKitWebSrcNeedData):
3769         (webKitWebSrcEnoughData):
3770         (webKitWebSrcSeek):
3771         (StreamingClient::handleResponseReceived):
3772         (StreamingClient::handleDataReceived):
3773         (StreamingClient::handleNotifyFinished):
3774         (webKitWebSrcFinalize): Deleted.
3775         (webKitWebSrcSetProperty): Deleted.
3776         (webKitWebSrcGetProperty): Deleted.
3777         (webKitWebSrcSetExtraHeader): Deleted.
3778         (webKitWebSrcStart): Deleted.
3779         (webKitWebSrcGetProtocols): Deleted.
3780         (webKitWebSrcGetUri): Deleted.
3781         (webKitWebSrcSetUri): Deleted.
3782         (webKitWebSrcUriHandlerInit): Deleted.
3783
3784 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3785
3786         [GStreamer] Use MainThreadNotifier to send notifications to main thread in TrackPrivateGStreamer
3787         https://bugs.webkit.org/show_bug.cgi?id=150889
3788
3789         Reviewed by Žan Doberšek.
3790
3791         Instead of the GThreadSafeMainLoopSources.
3792
3793         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
3794         (WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer):
3795         (WebCore::InbandTextTrackPrivateGStreamer::handleSample):
3796         (WebCore::InbandTextTrackPrivateGStreamer::streamChanged):
3797         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
3798         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3799         (WebCore::TrackPrivateBaseGStreamer::TrackPrivateBaseGStreamer):
3800         (WebCore::TrackPrivateBaseGStreamer::disconnect):
3801         (WebCore::TrackPrivateBaseGStreamer::activeChangedCallback):
3802         (WebCore::TrackPrivateBaseGStreamer::tagsChangedCallback):
3803         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
3804         (WebCore::TrackPrivateBaseGStreamer::~TrackPrivateBaseGStreamer): Deleted.
3805         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged): Deleted.
3806         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3807
3808 2015-11-06  Csaba Osztrogonác  <ossy@webkit.org>
3809
3810         Suppress deprecated-declarations warning in WebCore/platform/URL.cpp
3811         https://bugs.webkit.org/show_bug.cgi?id=150803
3812
3813         Reviewed by Alexey Proskuryakov.
3814
3815         * platform/URL.cpp:
3816         (WebCore::appendEncodedHostname):
3817
3818 2015-11-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3819
3820         [GStreamer] Do not use GThreadSafeMainLoopSource to send notifications to the main thread in MediaPlayerPrivateGStreamer
3821         https://bugs.webkit.org/show_bug.cgi?id=150888
3822
3823         Reviewed by Žan Doberšek.
3824
3825         Analyzing how the main loop sources were used in GST code I've
3826         noticed that in most of the cases they are used to send
3827         notifications to the main thread. The way it works in those cases
3828         is that some state is updated in whatever thread and we notify the
3829         main thread to use the new state. There's no data passed to the
3830         main thread, they are just notifications. I've also noticed that
3831         we are not doing this exactly as expected in several of those
3832         cases. GThreadSafeMainLoopSource cancels the current source when a
3833         new one is scheduled, and that was done this way because previous
3834         code in GST using GSources directly did it that way. But that's
3835         not what we want, if there's a notification pending, since the
3836         state is updated, we can just wait for it to happen instead of
3837         cancelling and scheduling a new one. I've also noticed that in
3838         most of the cases where we schedule notifications to the main
3839         thread, we can be already in the main thread, so we could avoid
3840         the schedule entirely.
3841         We can use RunLoop::dispatch() to send notifications to the main
3842         thread, but there's no way to cancel those tasks. This patch adds
3843         a new helper class MainThreadNotifier that uses an enum of flags to
3844         handle different kind of notifications. It uses
3845         RunLoop::dispatch() to send notifications to the main thread, but
3846         only if there isn't one pending for the given type.
3847         This patch also makes signal callbacks static members to be able
3848         to make the private methods actually private.
3849
3850         * platform/graphics/gstreamer/MainThreadNotifier.h: Added.
3851         (WebCore::MainThreadNotifier::MainThreadNotifier):
3852         (WebCore::MainThreadNotifier::notify):
3853         (WebCore::MainThreadNotifier::cancelPendingNotifications):
3854         (WebCore::MainThreadNotifier::addPendingNotification):
3855         (WebCore::MainThreadNotifier::removePendingNotification):
3856         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3857         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamPropertiesCallback):
3858         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3859         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
3860         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
3861         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
3862         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
3863         (WebCore::MediaPlayerPrivateGStreamer::newTextSampleCallback):
3864         (WebCore::MediaPlayerPrivateGStreamer::sourceChangedCallback):
3865         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
3866         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3867         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): Deleted.
3868         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine): Deleted.
3869         (WebCore::initializeGStreamerAndRegisterWebKitElements): Deleted.
3870         (WebCore::MediaPlayerPrivateGStreamer::load): Deleted.
3871         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Deleted.
3872         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Deleted.
3873         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): Deleted.
3874         (WebCore::MediaPlayerPrivateGStreamer::canSaveMediaData): Deleted.
3875         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3876         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3877         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3878         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
3879         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
3880         (WebCore::MediaPlayerPrivateGStreamerBase::repaintCallback):
3881         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback):
3882         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
3883         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
3884         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Deleted.
3885         (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline): Deleted.
3886         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Deleted.
3887         (WebCore::MediaPlayerPrivateGStreamerBase::muted): Deleted.
3888         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
3889         (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount): Deleted.
3890         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3891         (WebCore::MediaPlayerPrivateGStreamerBase::setVisible): Deleted.
3892
3893 2015-11-06  Yoav Weiss  <yoav@yoav.ws>
3894
3895         Expose HTMLImageElement sizes attribute in IDL
3896         https://bugs.webkit.org/show_bug.cgi?id=150230
3897
3898         Reviewed by Darin Adler.
3899
3900         No new tests, but fixed test expectations for exposed interfaces.
3901
3902         * html/HTMLImageElement.idl: Make sure that `sizes` is exposed as an IDL attribute, to ensure proper feature detection of sizes support.
3903
3904 2015-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3905
3906         [GStreamer] Use RunLoop::Timer instead of GMainLoopSource in video sink
3907         https://bugs.webkit.org/show_bug.cgi?id=150807
3908
3909         Reviewed by Žan Doberšek.
3910
3911         Since we always wait until the sample is actually rendered we
3912         don't really need either a thread safe main loop source, nor
3913         cancelling if already requested and other things GMainLoopSource does.
3914         This adds a helper class VideoRenderRequestScheduler to use the
3915         RunLoop::Timer. All the logic to syncronize between threads has
3916         been moved to this helper class too.
3917
3918         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3919         (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
3920         (VideoRenderRequestScheduler::start):
3921         (VideoRenderRequestScheduler::stop):
3922         (VideoRenderRequestScheduler::requestRender):
3923         (VideoRenderRequestScheduler::isUnlocked):
3924         (VideoRenderRequestScheduler::render):
3925         (_WebKitVideoSinkPrivate::_WebKitVideoSinkPrivate):
3926         (webkitVideoSinkRepaintRequested):
3927         (webkitVideoSinkRender):
3928         (webkitVideoSinkUnlock):
3929         (webkitVideoSinkUnlockStop):
3930         (webkitVideoSinkStop):
3931         (webkitVideoSinkStart):
3932         (_WebKitVideoSinkPrivate::~_WebKitVideoSinkPrivate): Deleted.
3933         (webkitVideoSinkTimeoutCallback): Deleted.
3934         (unlockSampleMutex): Deleted.
3935
3936 2015-11-05  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
3937
3938         Add runtime and compile time flags for enabling Web Animations API and model.
3939         https://bugs.webkit.org/show_bug.cgi?id=150914
3940
3941         Reviewed by Benjamin Poulain.
3942
3943         Add ENABLE_WEB_ANIMATIONS compile time flag, runtime flag webAnimationsEnabled and Expose WK2 preference for runtime flag.
3944
3945         * Configurations/FeatureDefines.xcconfig:
3946         * bindings/generic/RuntimeEnabledFeatures.cpp:
3947         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
3948         * bindings/generic/RuntimeEnabledFeatures.h:
3949         (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled):
3950         (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled):
3951
3952 2015-11-05  Commit Queue  <commit-queue@webkit.org>
3953
3954         Unreviewed, rolling out r192089.
3955         https://bugs.webkit.org/show_bug.cgi?id=150966
3956
3957         This change broke an existing layout test on Yosemite and
3958         Mavericks (Requested by ryanhaddad on #webkit).
3959
3960         Reverted changeset:
3961
3962         "Preview on apple.com/contact with all text selected shows a
3963         map"
3964         https://bugs.webkit.org/show_bug.cgi?id=150963
3965         http://trac.webkit.org/changeset/192089
3966
3967 2015-11-05  Tim Horton  <timothy_horton@apple.com>
3968
3969         Preview on apple.com/contact with all text selected shows a map
3970         https://bugs.webkit.org/show_bug.cgi?id=150963
3971         <rdar://problem/23421750>
3972
3973         Reviewed by Beth Dakin.
3974
3975         * editing/mac/DictionaryLookup.h:
3976         * editing/mac/DictionaryLookup.mm:
3977         (WebCore::DictionaryLookup::rangeForSelection):
3978         If the range that Lookup decides to use doesn't intersect the hit point,
3979         just ignore Lookup.
3980
3981         (WebCore::DictionaryLookup::rangeAtHitTestResult):
3982         If the selection-based Lookup fails to find a usable result, fall back
3983         to looking around the hit point.
3984
3985 2015-11-05  Brady Eidson  <beidson@apple.com>
3986
3987         Modern IDB: Implement IDBIndex get/getKey/count requests.
3988         https://bugs.webkit.org/show_bug.cgi?id=150910
3989
3990         Reviewed by Alex Christensen.
3991
3992         Tests: storage/indexeddb/modern/index-get-count-basic.html
3993                storage/indexeddb/modern/index-get-count-failures.html
3994
3995         * Modules/indexeddb/IndexedDB.h:
3996
3997         * Modules/indexeddb/client/IDBAnyImpl.cpp:
3998         (WebCore::IDBClient::IDBAny::IDBAny):
3999         (WebCore::IDBClient::IDBAny::modernIDBIndex):
4000         * Modules/indexeddb/client/IDBAnyImpl.h:
4001         (WebCore::IDBClient::IDBAny::create):
4002         (WebCore::IDBClient::IDBAny::createUndefined):
4003
4004         * Modules/indexeddb/client/IDBIndexImpl.cpp:
4005         (WebCore::IDBClient::IDBIndex::count):
4006         (WebCore::IDBClient::IDBIndex::doCount):
4007         (WebCore::IDBClient::IDBIndex::get):
4008         (WebCore::IDBClient::IDBIndex::doGet):
4009         (WebCore::IDBClient::IDBIndex::getKey):
4010         (WebCore::IDBClient::IDBIndex::doGetKey):
4011         * Modules/indexeddb/client/IDBIndexImpl.h:
4012         (WebCore::IDBClient::IDBIndex::info):
4013         
4014         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
4015         (WebCore::IDBClient::IDBObjectStore::isDeleted):
4016         (WebCore::IDBClient::IDBObjectStore::modernTransaction):
4017         
4018         * Modules/indexeddb/client/IDBRequestImpl.cpp:
4019         (WebCore::IDBClient::IDBRequest::createCount):
4020         (WebCore::IDBClient::IDBRequest::createGet):
4021         (WebCore::IDBClient::IDBRequest::IDBRequest):
4022         (WebCore::IDBClient::IDBRequest::sourceObjectStoreIdentifier):
4023         (WebCore::IDBClient::IDBRequest::sourceIndexIdentifier):
4024         (WebCore::IDBClient::IDBRequest::requestedIndexRecordType):
4025         (WebCore::IDBClient::IDBRequest::setResultToUndefined):
4026         *&nbs