e152c4f72b4ce338ee78c2829954bf6cf658e830
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-11-20  Brent Fulgham  <bfulgham@apple.com>
2
3         [Win] Support High DPI drawing with CACFLayers
4         https://bugs.webkit.org/show_bug.cgi?id=147242
5         <rdar://problem/19861992>
6
7         Reviewed by Simon Fraser.
8
9         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
10         (WebCore::WKCACFViewLayerTreeHost::initializeContext): Set correct content scale factor
11         for current screen, and apply an appropriate base transform to the CACFLayer so drawing
12         operations are done properly.
13
14 2015-11-20  Brady Eidson  <beidson@apple.com>
15
16         Modern IDB: In the VersionChangeEvent for delete database calls, oldVersion should be null instead of 0.
17         https://bugs.webkit.org/show_bug.cgi?id=151481
18
19         Reviewed by Sam Weinig.
20
21         No new tests, covered by changes to:
22             storage/indexeddb/modern/deletedatabase-1.html
23             storage/indexeddb/modern/deletedatabase-2.html
24
25         * Modules/indexeddb/IDBVersionChangeEvent.h:
26         * Modules/indexeddb/IDBVersionChangeEvent.idl:
27         
28         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
29         (WebCore::IDBClient::IDBVersionChangeEvent::newVersion):
30         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h:
31         
32         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
33         (WebCore::LegacyVersionChangeEvent::newVersion):
34         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h:
35
36 2015-11-20  Brady Eidson  <beidson@apple.com>
37
38         Addressing missed review feedback for:
39         Modern IDB: Make in-memory ObjectStore cursors work.
40         https://bugs.webkit.org/show_bug.cgi?id=151196
41
42         Reviewed by Darin Adler.
43
44         * Modules/indexeddb/server/MemoryObjectStore.cpp:
45         (WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor):
46         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
47         (WebCore::IDBServer::MemoryObjectStoreCursor::create): Deleted.
48         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
49
50 2015-11-20  Chris Dumez  <cdumez@apple.com>
51
52         Caching of properties on objects that have named property getters is sometimes incorrect
53         https://bugs.webkit.org/show_bug.cgi?id=151453
54         <rdar://problem/23049343>
55
56         Reviewed by Gavin Barraclough.
57
58         In r188590, we dropped the JSC::GetOwnPropertySlotIsImpure TypeInfo flag for
59         interfaces that have a non-'OverrideBuiltins' named property getter in order
60         to allow caching of properties returns by GetOwnPropertySlot(). We assumed
61         this was safe as it was no longer possible for named properties to override
62         own properties (or properties on the prototype).
63
64         However, there is an issue when we cache the non-existence of a property.
65         Even though at one point the property did not exist, a named property with
66         this name may later become available. In such case, caching would cause us
67         to wrongly report a property as missing.
68
69         To address the problem, this patch introduces a new
70         GetOwnPropertySlotIsImpureForPropertyAbsence TypeInfo flag and uses it for
71         interfaces that have a non-'OverrideBuiltins' named property getter. This
72         will cause us to not cache the fact that a property is missing on such
73         objects, while maintaining the performance win from r188590 in the common
74         case.
75
76         Test: fast/dom/NamedNodeMap-named-getter-caching.html
77
78         * bindings/scripts/CodeGeneratorJS.pm:
79         (GenerateHeader):
80         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
81         * bindings/scripts/test/JS/JSTestEventTarget.h:
82         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
83
84 2015-11-19  Simon Fraser  <simon.fraser@apple.com>
85
86         Back-buffer to front-buffer copy fails for some buffer formats
87         https://bugs.webkit.org/show_bug.cgi?id=151475
88         rdar://problem/23617899
89
90         Reviewed by Tim Horton.
91         
92         Fix some fo the bitsPerComponent/bitsPerPixel options in IOSurface::ensurePlatformContext()
93         for RGB10 buffers. Fix IOSurface::format() to return the new formats.
94         
95         Implement IOSurface::copyToSurface(), which does a synchronous copy between
96         surfaces.
97
98         * platform/graphics/cocoa/IOSurface.h:
99         * platform/graphics/cocoa/IOSurface.mm:
100         (IOSurface::create):
101         (IOSurface::ensurePlatformContext):
102         (IOSurface::format):
103         (IOSurface::copyToSurface):
104
105 2015-11-20  Zalan Bujtas  <zalan@apple.com>
106
107         Simple line layout: Add text-indent support.
108         https://bugs.webkit.org/show_bug.cgi?id=151472
109
110         Reviewed by Simon Fraser.
111
112         This enables us to use simple line layout on text-indent content.
113
114         Test: fast/text/simple-line-text-indent.html
115
116         * rendering/SimpleLineLayout.cpp:
117         (WebCore::SimpleLineLayout::updateLineConstrains):
118         (WebCore::SimpleLineLayout::createTextRuns):
119         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
120
121 2015-11-20  Brady Eidson  <beidson@apple.com>
122
123         Modern IDB: IDBFactory.deleteDatabase() support.
124         https://bugs.webkit.org/show_bug.cgi?id=151456
125
126         Reviewed by Alex Christensen.
127
128         Tests: storage/indexeddb/modern/deletedatabase-1.html
129                storage/indexeddb/modern/deletedatabase-2.html
130
131         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
132         (WebCore::IDBClient::IDBDatabase::hasPendingActivity):
133         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
134         * Modules/indexeddb/client/IDBDatabaseImpl.h:
135         
136         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
137         (WebCore::IDBClient::IDBOpenDBRequest::onDeleteDatabaseSuccess):
138         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted):
139         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
140         
141         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
142         (WebCore::IDBClient::IDBTransaction::hasPendingActivity): Deleted.
143         
144         * Modules/indexeddb/server/IDBServer.cpp:
145         (WebCore::IDBServer::IDBServer::deleteDatabase):
146         (WebCore::IDBServer::IDBServer::deleteUniqueIDBDatabase):
147         * Modules/indexeddb/server/IDBServer.h:
148         
149         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
150         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
151         (WebCore::IDBServer::UniqueIDBDatabase::hasAnyPendingCallbacks):
152         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase):
153         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
154         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
155         (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade):
156         (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChange):
157         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
158         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
159         (WebCore::IDBServer::UniqueIDBDatabase::invokeDeleteOrRunTransactionTimer):
160         (WebCore::IDBServer::UniqueIDBDatabase::deleteOrRunTransactionsTimerFired):
161         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
162         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
163         (WebCore::IDBServer::UniqueIDBDatabase::invokeTransactionScheduler): Deleted.
164         (WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired): Deleted.
165         * Modules/indexeddb/server/UniqueIDBDatabase.h:
166         (WebCore::IDBServer::UniqueIDBDatabase::identifier):
167         (WebCore::IDBServer::UniqueIDBDatabase::deletePending):
168         
169         * Modules/indexeddb/shared/IDBResultData.cpp:
170         (WebCore::IDBResultData::deleteDatabaseSuccess):
171         * Modules/indexeddb/shared/IDBResultData.h:
172
173 2015-11-20  Brady Eidson  <beidson@apple.com>
174
175         Modern IDB: Get IDBRequest.readyState right.
176         https://bugs.webkit.org/show_bug.cgi?id=151484
177
178         Reviewed by Alex Christensen.
179
180         Test: storage/indexeddb/modern/request-readystate.html
181
182         * Modules/indexeddb/client/IDBRequestImpl.cpp:
183         (WebCore::IDBClient::IDBRequest::readyState):
184
185 2015-11-20  Youenn Fablet  <youenn.fablet@crf.canon.fr>
186
187         Use HTTPHeaderName as much as possible in XMLHttpRequest
188         https://bugs.webkit.org/show_bug.cgi?id=151438
189
190         Reviewed by Darin Adler.
191
192         Removing XMLHttpRequest::setRequestHeaderInternal and XMLHttpRequest::getRequestHeader.
193         Using directly HTTPHeaderMap.add, HTTPHeaderMap.set and HTTPHeaderMap.get.
194
195         No change in behavior.
196
197         * xml/XMLHttpRequest.cpp:
198         (WebCore::XMLHttpRequest::send):
199         (WebCore::XMLHttpRequest::setRequestHeader):
200         (WebCore::XMLHttpRequest::getAllResponseHeaders):
201         * xml/XMLHttpRequest.h:
202
203 2015-11-20  Eric Carlson  <eric.carlson@apple.com>
204
205         MediaStream: Fix mock video source crash
206         https://bugs.webkit.org/show_bug.cgi?id=151462
207
208         Reviewed by Alexey Proskuryakov.
209
210         No new tests, this fixes existing tests.
211
212         * platform/mock/MockRealtimeVideoSource.cpp:
213         (WebCore::MockRealtimeVideoSource::drawText): Declare the String used to intialize a 
214           StringView explicitly so it outlives the StringView.
215
216 2015-11-20  David Kilzer  <ddkilzer@apple.com>
217
218         REGRESSION (r192460,r192677): Fix all the builds
219
220         * platform/spi/cocoa/QuartzCoreSPI.h: Check different.
221
222 2015-11-19  David Kilzer  <ddkilzer@apple.com>
223
224         REGRESSION (r192460): Fix tvOS build again
225
226         * platform/spi/cocoa/QuartzCoreSPI.h: Update version check.
227         This will probably need to be backed out in the future.
228
229 2015-11-19  Adam Bergkvist  <adam.bergkvist@ericsson.com>
230
231         WebRTC: Initial testing of updated RTCPeerConnection API
232         https://bugs.webkit.org/show_bug.cgi?id=151304
233
234         Reviewed by Eric Carlson.
235
236         Remove faulty ASSERT since the selector argument to
237         RTCPeerConnection.getStats() is nullable. Also use
238         pointers instead of a ref (for the same reason).
239
240         Tests: Unskip two crashing tests.
241
242         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
243         (WebCore::MediaEndpointPeerConnection::getStats):
244         * Modules/mediastream/MediaEndpointPeerConnection.h:
245         * Modules/mediastream/PeerConnectionBackend.h:
246         * Modules/mediastream/RTCPeerConnection.cpp:
247         (WebCore::RTCPeerConnection::privateGetStats):
248
249 2015-11-19  Hunseop Jeong  <hs85.jeong@samsung.com>
250
251         [EFL][GTK] context_menu API test failed after r192333
252         https://bugs.webkit.org/show_bug.cgi?id=151437
253
254         Reviewed by Carlos Garcia Campos.
255
256         EFL,GTK port didn't use the share Menu.
257
258         * page/ContextMenuController.cpp:
259         (WebCore::ContextMenuController::populate):
260
261 2015-11-19  Brian Burg  <bburg@apple.com>
262
263         Web Inspector: yank/kill shortcuts (CTRL+Y, K) don't work in Console / QuickConsole
264         https://bugs.webkit.org/show_bug.cgi?id=151157
265
266         Reviewed by Joseph Pecoraro.
267
268         CodeMirror maintains its own editor buffer and implements its own
269         `killLine` command but doesn't implement the yank command. So, text
270         that is "killed" with CTRL-k inside a CodeMirror instance isn't
271         added to Editor's kill ring. Subsequent yank commands won't match
272         up with the killed text, instead returning text from a prior kill
273         that was handled by Editor (i.e., in a contenteditable or form input).
274
275         This patch adds a host function so that the Inspector frontend can
276         append "missed" killed text to Editor's kill ring. Subsequent
277         yanks handled by Editor will then match the text killed by CodeMirror.
278
279         No new tests, because we need to use both InspectorFrontendHost
280         and TestRunner.execCommand, but the latter is not available in
281         the inspector context where we would need to simulate a kill.
282
283         * inspector/InspectorFrontendHost.cpp:
284         (WebCore::InspectorFrontendHost::killText):
285
286             Added. This appends the killed text to the kill ring, starting
287             a new sequence if necessary. Unlike Editor, Inspector waits
288             until the next kill command to clear the existing sequence.
289
290         * inspector/InspectorFrontendHost.h:
291         * inspector/InspectorFrontendHost.idl:
292
293 2015-11-19  Zalan Bujtas  <zalan@apple.com>
294
295         Simple line layout: Add word-spacing support.
296         https://bugs.webkit.org/show_bug.cgi?id=151420
297
298         Reviewed by Antti Koivisto.
299
300         This enables us to use simple line layout on word-spacing content.
301
302         Test: fast/text/simple-line-wordspacing.html
303
304         * rendering/SimpleLineLayout.cpp:
305         (WebCore::SimpleLineLayout::createLineRuns):
306         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
307         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
308         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
309         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
310         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
311         * rendering/SimpleLineLayoutTextFragmentIterator.h:
312
313 2015-11-19  Brady Eidson  <beidson@apple.com>
314
315         Modern IDB: IDBObjectStore.deleteIndex() support.
316         https://bugs.webkit.org/show_bug.cgi?id=150911
317
318         Reviewed by Alex Christensen.
319
320         Tests: storage/indexeddb/modern/deleteindex-1.html
321                storage/indexeddb/modern/deleteindex-2.html
322
323         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
324         (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
325         (WebCore::IDBClient::IDBConnectionToServer::didDeleteIndex):
326         * Modules/indexeddb/client/IDBConnectionToServer.h:
327         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
328
329         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
330         (WebCore::IDBClient::IDBDatabase::didDeleteIndexInfo):
331         * Modules/indexeddb/client/IDBDatabaseImpl.h:
332
333         * Modules/indexeddb/client/IDBIndexImpl.cpp:
334         (WebCore::IDBClient::IDBIndex::markAsDeleted):
335         * Modules/indexeddb/client/IDBIndexImpl.h:
336
337         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
338         (WebCore::IDBClient::IDBObjectStore::index):
339         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
340
341         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
342         (WebCore::IDBClient::IDBTransaction::deleteIndex):
343         (WebCore::IDBClient::IDBTransaction::deleteIndexOnServer):
344         (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
345         * Modules/indexeddb/client/IDBTransactionImpl.h:
346
347         * Modules/indexeddb/client/TransactionOperation.h:
348         (WebCore::IDBClient::createTransactionOperation):
349
350         * Modules/indexeddb/server/IDBBackingStore.h:
351
352         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
353         (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
354         * Modules/indexeddb/server/IDBConnectionToClient.h:
355         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
356
357         * Modules/indexeddb/server/IDBServer.cpp:
358         (WebCore::IDBServer::IDBServer::deleteIndex):
359         * Modules/indexeddb/server/IDBServer.h:
360
361         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
362         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
363         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
364         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
365
366         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
367         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
368         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
369
370         * Modules/indexeddb/server/MemoryIndex.cpp:
371         (WebCore::IDBServer::MemoryIndex::clearIndexValueStore):
372         * Modules/indexeddb/server/MemoryIndex.h:
373
374         * Modules/indexeddb/server/MemoryObjectStore.cpp:
375         (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
376         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
377         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
378         * Modules/indexeddb/server/MemoryObjectStore.h:
379
380         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
381         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
382         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
383         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
384         * Modules/indexeddb/server/UniqueIDBDatabase.h:
385
386         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
387         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
388         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
389
390         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
391         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
392         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
393
394         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
395         (WebCore::IDBDatabaseInfo::loggingString):
396         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
397
398         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
399         (WebCore::IDBIndexInfo::loggingString):
400         * Modules/indexeddb/shared/IDBIndexInfo.h:
401
402         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
403         (WebCore::IDBObjectStoreInfo::hasIndex):
404         (WebCore::IDBObjectStoreInfo::deleteIndex):
405         (WebCore::IDBObjectStoreInfo::loggingString):
406         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
407
408         * Modules/indexeddb/shared/IDBResultData.cpp:
409         (WebCore::IDBResultData::deleteIndexSuccess):
410         * Modules/indexeddb/shared/IDBResultData.h:
411
412         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
413         (WebCore::InProcessIDBServer::didDeleteIndex):
414         (WebCore::InProcessIDBServer::createIndex):
415         (WebCore::InProcessIDBServer::deleteIndex):
416         * Modules/indexeddb/shared/InProcessIDBServer.h:
417
418 2015-11-19  Brian Burg  <bburg@apple.com>
419
420         REGRESSION(r8780): Backwards delete by word incorrectly appends deleted text to kill ring, should be prepend
421         https://bugs.webkit.org/show_bug.cgi?id=151300
422
423         Reviewed by Darin Adler.
424
425         Over 11 years ago, someone was in a big hurry to fix a bunch
426         of emacs keybindings bugs, and accidentally regressed the kill ring
427         behavior for backwards-delete-word. It should prepend to the beginning.
428
429         This patch fixes the regression and cleans up the kill ring-related
430         code in Editor and commands. It also adds some tests to cover the
431         regressed code a bit better.
432
433         Tests: editing/pasteboard/emacs-killring-alternating-append-prepend.html
434                editing/pasteboard/emacs-killring-backward-delete-prepend.html
435
436         * editing/Editor.cpp:
437
438             Use more explicit names for insertion mode parameters and member variables.
439
440         (WebCore::Editor::deleteWithDirection):
441         (WebCore::Editor::performDelete):
442         (WebCore::Editor::addRangeToKillRing):
443         (WebCore::Editor::addTextToKillRing):
444
445             Only one call site for now, but another will be added in a dependent fix.
446
447         (WebCore::Editor::addToKillRing): Deleted.
448         * editing/Editor.h:
449         * editing/TypingCommand.cpp:
450         (WebCore::TypingCommand::TypingCommand):
451         (WebCore::TypingCommand::deleteKeyPressed):
452         (WebCore::TypingCommand::forwardDeleteKeyPressed):
453         (WebCore::TypingCommand::doApply):
454         * editing/TypingCommand.h:
455         * platform/mac/KillRingMac.mm:
456         (WebCore::KillRing::append):
457         (WebCore::KillRing::prepend):
458
459             It turns out that the native API implicitly clears the kill sequence when
460             alternating between prepend and append operations. Its behavior does not match
461             what Sublime Text or Emacs do in this case. Clear the previous operation flag
462             to prevent this behavior from happening.
463
464 2015-11-19  Myles C. Maxfield  <mmaxfield@apple.com>
465
466         Tatechuyoko in ruby sits too high
467         https://bugs.webkit.org/show_bug.cgi?id=151309
468         <rdar://problem/23536621>
469
470         Reviewed by Darin Adler.
471
472         When combining text, we ask what the text's width is in order to determine if it fits in the
473         column. However, when we do that, we were not setting the font's orientation to horizontal.
474         This means that, for CJK text, the "width" which was returned was actually the height of the
475         glyph, and the GlyphOverflow data was similarly garbled.
476
477         We actually already were creating a corrected FontDescription, and using it in two places.
478         However, we weren't using it in the last place, which was causing this bug.
479
480         Test: fast/text/text-combine-placement.html
481
482         * platform/graphics/FontCascade.cpp:
483         (WebCore::FontCascade::width):
484         * rendering/RenderCombineText.cpp:
485         (WebCore::RenderCombineText::combineText):
486
487 2015-11-19  Hunseop Jeong  <hs85.jeong@samsung.com>
488
489         [EFL] http/tests/navigation/useragent test failed after r192459.
490         https://bugs.webkit.org/show_bug.cgi?id=151340
491
492         Reviewed by Gyuyoung Kim.
493
494         We need the convert process the predifined value to string. 
495
496         * platform/efl/UserAgentEfl.cpp:
497         (WebCore::versionForUAString):
498
499 2015-11-19  Commit Queue  <commit-queue@webkit.org>
500
501         Unreviewed, rolling out r192622.
502         https://bugs.webkit.org/show_bug.cgi?id=151446
503
504         This test is failing on multiple mac testers (Requested by
505         ryanhaddad on #webkit).
506
507         Reverted changeset:
508
509         "Add a test for media control dropoff"
510         https://bugs.webkit.org/show_bug.cgi?id=151287
511         http://trac.webkit.org/changeset/192622
512
513 2015-11-19  Csaba Osztrogonác  <ossy@webkit.org>
514
515         [EFL] Fix -Winconsistent-missing-override clang warnings
516         https://bugs.webkit.org/show_bug.cgi?id=151443
517
518         Reviewed by Darin Adler.
519
520         * loader/EmptyClients.h:
521         (WebCore::EmptyChromeClient::delegatedScrollRequested):
522         (WebCore::EmptyChromeClient::scheduleAnimation):
523
524 2015-11-19  Jon Lee  <jonlee@apple.com>
525
526         Add a test for media control dropoff
527         https://bugs.webkit.org/show_bug.cgi?id=151287
528         rdar://problem/23544666
529
530         Reviewed by Dean Jackson.
531
532         Test: media/controls/inline-elements-dropoff-order.html
533
534         * Modules/mediacontrols/mediaControlsApple.css:
535         (audio::-webkit-media-controls-timeline-container.dropped): Override the
536         display:none since we want the container to remain visible but acting
537         as a flexible width space to push the other elements to the ends of the
538         inline flexbox. We will want to refactor the CSS rules so that all of the
539         components in the timeline are keyed off of the container's dropped class
540         rather than having each individual component have that class attached.
541         (audio::-webkit-media-controls-panel.hidden): Deleted. Consolidate a
542         couple rules.
543         * Modules/mediacontrols/mediaControlsApple.js:
544         (Controller.prototype.updateLayoutForDisplayedWidth): Also attach the
545         "dropped" class on the timeline box. Add the captions button for reporting
546         media control state.
547         * testing/Internals.cpp:
548         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Extend this to
549         also take "DeviceNotAvailable" to update the mock device's availability.
550
551         * testing/Internals.cpp: Update to use a reference to Page.
552         (WebCore::Internals::resetToConsistentState): Reset mock enabled setting for
553         each test.
554         * testing/Internals.h:
555         * testing/js/WebCoreTestSupport.cpp:
556         (WebCoreTestSupport::resetInternalsObject): Update to use a reference to Page.
557
558 2015-11-19  Xabier Rodriguez Calvar  <calvaris@igalia.com>
559
560         [Streams API] Implement IsReadableStreamDisturbed according to spec
561         https://bugs.webkit.org/show_bug.cgi?id=151356
562
563         Reviewed by Darin Adler.
564
565         Implemente IsReadableStreamDisturbed according to the spec. This is an internal function to be used by other
566         internal implementations.
567
568         The function is exported as internals to be tested.
569
570         Test: streams/reference-implementation/abstract-ops.html.
571
572         * Modules/streams/ReadableStream.js:
573         (initializeReadableStream):
574         * Modules/streams/ReadableStreamInternals.js:
575         (cancelReadableStream):
576         (readFromReadableStreamReader):
577         (isReadableStreamDisturbed):
578         * bindings/js/WebCoreBuiltinNames.h:
579         * testing/Internals.cpp:
580         (WebCore::Internals::isReadableStreamDisturbed):
581         * testing/Internals.h:
582         * testing/Internals.idl:
583
584 2015-11-19  Youenn Fablet  <youenn.fablet@crf.canon.fr>
585
586         XHR should not combine empty content-type value with default one
587         https://bugs.webkit.org/show_bug.cgi?id=147784
588
589         Reviewed by Darin Adler.
590
591         Previously, XHR was testing whether a "Content-Type" was set using setRequestHeader by checking whether a "Content-Type" header value was empty.
592         This now tests whether "Content-Type" request header is set using either HTTPHeaderMap::contains or checking whether a "Content-Type" header value is null.
593
594         Test: http/tests/xmlhttprequest/post-empty-content-type.html
595
596         * xml/XMLHttpRequest.cpp:
597         (WebCore::XMLHttpRequest::send):
598
599 2015-11-19  Brady Eidson  <beidson@apple.com>
600
601         Modern IDB: Populate indexes created in object stores that already have records.
602         https://bugs.webkit.org/show_bug.cgi?id=151421
603
604         Reviewed by Alex Christensen.
605
606         Test: storage/indexeddb/modern/index-4.html
607               storage/indexeddb/modern/index-5.html
608
609         * Modules/indexeddb/server/MemoryObjectStore.cpp:
610         (WebCore::IDBServer::MemoryObjectStore::createIndex):
611         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
612         * Modules/indexeddb/server/MemoryObjectStore.h:
613
614 2015-11-18  Brady Eidson  <beidson@apple.com>
615
616         Modern IDB:Make in-memory Index cursors work.
617         https://bugs.webkit.org/show_bug.cgi?id=151278
618
619         Reviewed by Alex Christensen.
620
621         Tests: storage/indexeddb/modern/index-cursor-1.html
622                storage/indexeddb/modern/index-cursor-2.html
623                storage/indexeddb/modern/index-cursor-3.html
624
625         * CMakeLists.txt:
626         * WebCore.xcodeproj/project.pbxproj:
627
628         * Modules/indexeddb/client/IDBIndexImpl.cpp:
629         (WebCore::IDBClient::IDBIndex::openCursor):
630         (WebCore::IDBClient::IDBIndex::openKeyCursor):
631         
632         * Modules/indexeddb/server/IndexValueEntry.cpp:
633         (WebCore::IDBServer::IndexValueEntry::removeKey):
634         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
635         (WebCore::IDBServer::IndexValueEntry::Iterator::key):
636         (WebCore::IDBServer::IndexValueEntry::Iterator::isValid):
637         (WebCore::IDBServer::IndexValueEntry::Iterator::invalidate):
638         (WebCore::IDBServer::IndexValueEntry::Iterator::operator++):
639         (WebCore::IDBServer::IndexValueEntry::begin):
640         (WebCore::IDBServer::IndexValueEntry::reverseBegin):
641         (WebCore::IDBServer::IndexValueEntry::find):
642         (WebCore::IDBServer::IndexValueEntry::reverseFind):
643         * Modules/indexeddb/server/IndexValueEntry.h:
644         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
645         (WebCore::IDBServer::IndexValueEntry::unique):
646         
647         * Modules/indexeddb/server/IndexValueStore.cpp:
648         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey):
649         (WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange):
650         (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
651         (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
652         (WebCore::IDBServer::IndexValueStore::find):
653         (WebCore::IDBServer::IndexValueStore::reverseFind):
654         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
655         (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
656         (WebCore::IDBServer::IndexValueStore::Iterator::operator++):
657         (WebCore::IDBServer::IndexValueStore::Iterator::invalidate):
658         (WebCore::IDBServer::IndexValueStore::Iterator::isValid):
659         (WebCore::IDBServer::IndexValueStore::Iterator::key):
660         (WebCore::IDBServer::IndexValueStore::Iterator::primaryKey):
661         * Modules/indexeddb/server/IndexValueStore.h:
662         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
663         
664         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
665         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
666         
667         * Modules/indexeddb/server/MemoryIndex.cpp:
668         (WebCore::IDBServer::MemoryIndex::cursorDidBecomeClean):
669         (WebCore::IDBServer::MemoryIndex::cursorDidBecomeDirty):
670         (WebCore::IDBServer::MemoryIndex::objectStoreCleared):
671         (WebCore::IDBServer::MemoryIndex::notifyCursorsOfValueChange):
672         (WebCore::IDBServer::MemoryIndex::notifyCursorsOfAllRecordsChanged):
673         (WebCore::IDBServer::MemoryIndex::putIndexKey):
674         (WebCore::IDBServer::MemoryIndex::removeRecord):
675         (WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey):
676         (WebCore::IDBServer::MemoryIndex::maybeOpenCursor):
677         * Modules/indexeddb/server/MemoryIndex.h:
678         (WebCore::IDBServer::MemoryIndex::valueStore):
679         (WebCore::IDBServer::MemoryIndex::objectStore):
680         
681         * Modules/indexeddb/server/MemoryIndexCursor.cpp: Added.
682         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
683         (WebCore::IDBServer::MemoryIndexCursor::~MemoryIndexCursor):
684         (WebCore::IDBServer::MemoryIndexCursor::currentData):
685         (WebCore::IDBServer::MemoryIndexCursor::iterate):
686         (WebCore::IDBServer::MemoryIndexCursor::indexRecordsAllChanged):
687         (WebCore::IDBServer::MemoryIndexCursor::indexValueChanged):
688         * Modules/indexeddb/server/MemoryIndexCursor.h:
689         
690         * Modules/indexeddb/server/MemoryObjectStore.cpp:
691         (WebCore::IDBServer::MemoryObjectStore::indexForIdentifier):
692         (WebCore::IDBServer::MemoryObjectStore::valueForKey):
693         * Modules/indexeddb/server/MemoryObjectStore.h:
694         
695         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
696         (WebCore::IDBCursorInfo::objectStoreCursor):
697         (WebCore::IDBCursorInfo::indexCursor):
698         (WebCore::IDBCursorInfo::IDBCursorInfo):
699         (WebCore::IDBCursorInfo::isDirectionNoDuplicate):
700         (WebCore::IDBCursorInfo::isolatedCopy):
701         * Modules/indexeddb/shared/IDBCursorInfo.h:
702         (WebCore::IDBCursorInfo::objectStoreIdentifier):
703
704 2015-11-18  Antti Koivisto  <antti@apple.com>
705
706         Assertion failure in RenderTreePosition::computeNextSibling
707         https://bugs.webkit.org/show_bug.cgi?id=151337
708         rdar://problem/23250075
709
710         Reviewed by Zalan Bujtas.
711
712         Test: fast/html/details-mathml-crash.html
713
714         * html/ads: Added.
715         * style/StyleResolveTree.cpp:
716         (WebCore::Style::resolveChildAtShadowBoundary):
717
718             Factor common code for resolving child here from resolveShadowTree.
719
720         (WebCore::Style::resolveShadowTree):
721
722             We don't need StyleResolverParentPusher because shadow tree uses different style resolver anyway.
723
724         (WebCore::Style::resolveSlotAssignees):
725
726             This needs to call renderTreePosition.invalidateNextSibling() if there is a renderer already.
727             Achieve this by calling the new common function resolveChildAtShadowBoundary.
728
729 2015-11-18  Jer Noble  <jer.noble@apple.com>
730
731         WebGL slow video to texture
732         https://bugs.webkit.org/show_bug.cgi?id=129626
733
734         Reviewed by Dean Jackson.
735
736         Support a direct GPU-to-GPU copy of video textures. Add a new AVPlayerItemVideoOutput which,
737         when lazily-created, will emit CVPixelBuffers which are guaranteed to be compatible with
738         OpenGL framebuffers. Then, use a CVOpenGLTextureCache object to convert those CVPixelBuffers
739         to OpenGL textures. Once the video frame is in an OpenGL texture, use an OpenGL framebuffer
740         to copy the underlying video texture memory to the destination texture.
741
742         The copy step uses glTexImage2D, which requires format and type parameters, so change the
743         signature of copyVideoTextureToPlatformTexture() to pass those parameters in.
744
745         * html/HTMLVideoElement.cpp:
746         (WebCore::HTMLVideoElement::copyVideoTextureToPlatformTexture): Changed signature.
747         * html/HTMLVideoElement.h:
748         * html/canvas/WebGLRenderingContextBase.cpp:
749         (WebCore::WebGLRenderingContextBase::texImage2D): Changed signature.
750         * platform/graphics/MediaPlayer.cpp:
751         (WebCore::MediaPlayer::copyVideoTextureToPlatformTexture): Changed signature.
752         * platform/graphics/MediaPlayer.h:
753         * platform/graphics/MediaPlayerPrivate.h:
754         (WebCore::MediaPlayerPrivateInterface::copyVideoTextureToPlatformTexture): Changed signature.
755         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
756         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
757         (WebCore::MediaPlayerPrivateAVFoundationObjC::createOpenGLVideoOutput): Create an OpenGL-compatible
758             AVPlayerItemVideoOutput.
759         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyOpenGLVideoOutput): Destroy same.
760         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastOpenGLImage): Cache the current frame, if available.
761         (WebCore::MediaPlayerPrivateAVFoundationObjC::copyVideoTextureToPlatformTexture): Convert the
762             current frame to a texture, and use that texture to render into the destination texture.
763
764 2015-11-18  Jiewen Tan  <jiewen_tan@apple.com>
765
766         [WK1] Crash loading Blink layout test fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
767         https://bugs.webkit.org/show_bug.cgi?id=150198
768         <rdar://problem/23136026>
769
770         Reviewed by Brent Fulgham.
771
772         Test: fast/dom/Window/property-access-on-cached-window-after-frame-removed.html
773
774         Properties of a contentWindow could be accessed even if the frame who owns the window is
775         detached. Therefore, check whether the document loader is still alive before using it.
776
777         * page/PerformanceTiming.cpp:
778         (WebCore::PerformanceTiming::monotonicTimeToIntegerMilliseconds):
779
780 2015-11-18  Eric Carlson  <eric.carlson@apple.com>
781
782         MediaStream: Implement MediaDevices.getSupportedConstraints
783         https://bugs.webkit.org/show_bug.cgi?id=151394
784
785         Reviewed by Brent Fulgham.
786
787         Test: fast/mediastream/MediaDevices-getSupportedConstraints.html
788
789         * CMakeLists.txt: Add MediaTrackSupportedConstraints and JSMediaTrackSupportedConstraintsCustom.
790
791         * DerivedSources.make: Ditto.
792
793         * Modules/mediastream/MediaDevices.cpp:
794         (WebCore::MediaDevices::getSupportedConstraints): New.
795         * Modules/mediastream/MediaDevices.h:
796         * Modules/mediastream/MediaDevices.idl:
797
798         * Modules/mediastream/MediaTrackSupportedConstraints.h: Added. Wrapper around a 
799           RealtimeMediaSourceSupportedConstraints.
800         (WebCore::MediaTrackSupportedConstraints::create):
801         (WebCore::MediaTrackSupportedConstraints::supportsWidth):
802         (WebCore::MediaTrackSupportedConstraints::supportsHeight):
803         (WebCore::MediaTrackSupportedConstraints::supportsAspectRatio):
804         (WebCore::MediaTrackSupportedConstraints::supportsFrameRate):
805         (WebCore::MediaTrackSupportedConstraints::supportsFacingMode):
806         (WebCore::MediaTrackSupportedConstraints::supportsVolume):
807         (WebCore::MediaTrackSupportedConstraints::supportsSampleRate):
808         (WebCore::MediaTrackSupportedConstraints::supportsSampleSize):
809         (WebCore::MediaTrackSupportedConstraints::supportsEchoCancellation):
810         (WebCore::MediaTrackSupportedConstraints::supportsDeviceId):
811         (WebCore::MediaTrackSupportedConstraints::supportsGroupId):
812         (WebCore::MediaTrackSupportedConstraints::MediaTrackSupportedConstraints):
813         * Modules/mediastream/MediaTrackSupportedConstraints.idl: Added.
814
815         * WebCore.xcodeproj/project.pbxproj: Add JSMediaTrackSupportedConstraintsCustom.cpp, 
816           RealtimeMediaSourceSupportedConstraints.h, and MediaTrackSupportedConstraints.*.
817
818         A MediaTrackSupportedConstraints only contains the properties supported by the currently
819         available capture devices, so implement getOwnPropertySlot and getOwnPropertyNames so
820         we don't have to declare any attributes in the idl file.
821         * bindings/js/JSMediaTrackSupportedConstraintsCustom.cpp: Added.
822         (WebCore::JSMediaTrackSupportedConstraints::getOwnPropertySlotDelegate):
823         (WebCore::JSMediaTrackSupportedConstraints::getOwnPropertyNames):
824
825         * platform/mediastream/RealtimeMediaSourceCenter.h:
826         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h: Added.
827         (WebCore::RealtimeMediaSourceSupportedConstraints::RealtimeMediaSourceSupportedConstraints):
828         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsWidth):
829         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsWidth):
830         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsHeight):
831         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsHeight):
832         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsAspectRatio):
833         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsAspectRatio):
834         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsFrameRate):
835         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsFrameRate):
836         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsFacingMode):
837         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsFacingMode):
838         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsVolume):
839         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsVolume):
840         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsSampleRate):
841         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsSampleRate):
842         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsSampleSize):
843         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsSampleSize):
844         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsEchoCancellation):
845         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsEchoCancellation):
846         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsDeviceId):
847         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsDeviceId):
848         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsGroupId):
849         (WebCore::RealtimeMediaSourceSupportedConstraints::setSupportsGroupId):
850
851         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
852         (WebCore::RealtimeMediaSourceCenterMac::RealtimeMediaSourceCenterMac): Initialize supported constraints.
853         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
854
855         * platform/mock/MockRealtimeMediaSource.cpp: Delete some dead code.
856
857         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
858         (WebCore::MockRealtimeMediaSourceCenter::MockRealtimeMediaSourceCenter): Initialize supported constraints.
859         * platform/mock/MockRealtimeMediaSourceCenter.h:
860
861 2015-11-18  Alex Christensen  <achristensen@webkit.org>
862
863         Progress towards implementing Downloads with NETWORK_SESSION
864         https://bugs.webkit.org/show_bug.cgi?id=151414
865
866         Reviewed begrudgingly by Brady Eidson.
867
868         There is no change in behavior except that SessionIDs are sent across IPC and passed as parameters,
869         and they are not used yet.
870
871         * loader/DocumentLoader.cpp:
872         (WebCore::DocumentLoader::continueAfterContentPolicy):
873         Removed an unused default. Compiler warnings will let us know if we add an unhandled case to this switch.
874         * loader/EmptyClients.h:
875         * loader/FrameLoaderClient.h:
876         Pass SessionIDs around.
877
878 2015-11-18  Andreas Kling  <akling@apple.com>
879
880         ResourceUsageOverlay should have better accounting for reclaimable memory.
881         <https://webkit.org/b/151407>
882
883         Reviewed by Anders Carlsson.
884
885         Add code to inspect the purgeable state of VM regions when traversing the
886         web process VM map, and track reclaimable regions of memory separately.
887
888         Memory categories that have some amount of reclaimable memory are now
889         displayed with the reclaimable amount in brackets, e.g "123.45 MB [56.78MB]"
890
891         * page/ResourceUsageOverlay.h:
892         * page/cocoa/ResourceUsageOverlayCocoa.mm:
893         (WebCore::ResourceUsageOverlay::platformDraw):
894         (WebCore::TagInfo::TagInfo):
895         (WebCore::pagesPerVMTag):
896         (WebCore::runSamplerThread):
897         (WebCore::dirtyPagesPerVMTag): Deleted.
898
899 2015-11-18  Joseph Pecoraro  <pecoraro@apple.com>
900
901         Web Inspector: Client Blocked Resource Requests causes Crash under InspectorPageAgent::cachedResource
902         https://bugs.webkit.org/show_bug.cgi?id=151398
903
904         Reviewed by Brian Burg.
905
906         Test: inspector/network/client-blocked-load.html
907
908         * inspector/InspectorPageAgent.cpp:
909         (WebCore::InspectorPageAgent::cachedResource):
910         Gracefully handle null request.
911
912         * loader/cache/CachedResourceLoader.cpp:
913         (WebCore::CachedResourceLoader::cachedResource):
914         ASSERT if someone tried to pass a null URL.
915
916 2015-11-18  Joseph Pecoraro  <pecoraro@apple.com>
917
918         Web Inspector: Timeline Recording across page navigations behaves poorly
919         https://bugs.webkit.org/show_bug.cgi?id=151112
920
921         Reviewed by Timothy Hatcher.
922
923         * inspector/InspectorPageAgent.cpp:
924         (WebCore::InspectorPageAgent::frameStartedLoading): Deleted.
925         Don't reset the execution stopwatch on page navigation.
926         If a timeline is actively being recorded on the frontend
927         then all new timestamps suddenly downshifted towards zero
928         introduces bad data.
929
930 2015-11-18  Daniel Bates  <dabates@apple.com>
931
932         [iOS] ASSERTION FAILED: temporaryFilePath.last() == '/' in WebCore::openTemporaryFile()
933         https://bugs.webkit.org/show_bug.cgi?id=151392
934         <rdar://problem/23595341>
935
936         Reviewed by Alexey Proskuryakov.
937
938         Workaround <rdar://problem/23579077> where confstr(_CS_DARWIN_USER_TEMP_DIR, ..., ...) retrieves
939         the path to the user temporary directory without a trailing slash in the iOS simulator.
940
941         * platform/mac/FileSystemMac.mm:
942         (WebCore::openTemporaryFile): Add a path separator (/) between the directory path and filename.
943
944 2015-11-18  Chris Dumez  <cdumez@apple.com>
945
946         Null dereference in Performance::Performance(WebCore::Frame*)
947         https://bugs.webkit.org/show_bug.cgi?id=151390
948
949         Reviewed by Brady Eidson.
950
951         Based on the stack trace, it appears the DocumentLoader can be null
952         when constructing the Performance object. This patch thus adds a null
953         check before trying to dereference it.
954
955         No new tests, was not able to reproduce.
956
957         * page/DOMWindow.cpp:
958         (WebCore::DOMWindow::navigator):
959         (WebCore::DOMWindow::performance):
960         * page/Performance.cpp:
961         (WebCore::Performance::Performance):
962         (WebCore::Performance::scriptExecutionContext):
963         * page/Performance.h:
964
965 2015-11-18  Per Arne Vollan  <peavo@outlook.com>
966
967         [WinCairo][MediaFoundation] The main thread can sometimes be blocked forever when ending a media session.
968         https://bugs.webkit.org/show_bug.cgi?id=151387
969
970         Reviewed by Alex Christensen.
971
972         This happens because the main thread is waiting for the sample scheduler thread to finish,
973         but sometimes it never does. This can be resolved by emptying the scheduler's sample queue
974         before requesting the scheduler thread to finish. This will make sure the scheduler thread
975         returns to its main loop quickly, and can handle the termination request.
976
977         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
978         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
979
980 2015-11-18  Adam Bergkvist  <adam.bergkvist@ericsson.com>
981
982         WebRTC: Initial testing of updated RTCPeerConnection API
983         https://bugs.webkit.org/show_bug.cgi?id=151304
984
985         Reviewed by Eric Carlson.
986
987         Add an empty implementation of MediaEndpointPeerConnection which
988         realizes the PeerConnectionBackend interface. This makes it possible
989         to construct an RTCPeerConnection and do initial testing.
990
991         Tests: fast/mediastream/RTCPeerConnection-overloaded-operations-params.html
992                fast/mediastream/RTCPeerConnection-overloaded-operations.html
993
994         Also unskip three existing RTCPeerConnection tests on GTK.
995
996         * CMakeLists.txt:
997         * Modules/mediastream/MediaEndpointPeerConnection.cpp: Added.
998         (WebCore::createMediaEndpointPeerConnection):
999         (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection):
1000         (WebCore::MediaEndpointPeerConnection::createOffer):
1001         (WebCore::MediaEndpointPeerConnection::createAnswer):
1002         (WebCore::MediaEndpointPeerConnection::setLocalDescription):
1003         (WebCore::MediaEndpointPeerConnection::localDescription):
1004         (WebCore::MediaEndpointPeerConnection::currentLocalDescription):
1005         (WebCore::MediaEndpointPeerConnection::pendingLocalDescription):
1006         (WebCore::MediaEndpointPeerConnection::setRemoteDescription):
1007         (WebCore::MediaEndpointPeerConnection::remoteDescription):
1008         (WebCore::MediaEndpointPeerConnection::currentRemoteDescription):
1009         (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription):
1010         (WebCore::MediaEndpointPeerConnection::setConfiguration):
1011         (WebCore::MediaEndpointPeerConnection::addIceCandidate):
1012         (WebCore::MediaEndpointPeerConnection::getStats):
1013         (WebCore::MediaEndpointPeerConnection::stop):
1014         (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation):
1015         * Modules/mediastream/MediaEndpointPeerConnection.h: Added.
1016         * WebCore.xcodeproj/project.pbxproj:
1017
1018 2015-11-18  Alejandro G. Castro  <alex@igalia.com>
1019
1020         [Cairo] SolidStroke broken in drawLine after r191658
1021         https://bugs.webkit.org/show_bug.cgi?id=151385
1022
1023         Reviewed by Carlos Garcia Campos.
1024
1025         Fix the drawLine function after r191658, we have to make sure the
1026         color is set when line is SolidStroke.
1027
1028         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1029         (WebCore::GraphicsContext::drawLine):
1030
1031 2015-11-18  Javier Fernandez  <jfernandez@igalia.com>
1032
1033         [CSS Grid Layout] inline margins not honored when not using stretch in row-axis alignment
1034         https://bugs.webkit.org/show_bug.cgi?id=151323
1035
1036         Reviewed by Sergio Villar Senin.
1037
1038         There are some situations where we avoid to compute the inline-axis
1039         margins when computing the logical width of a box. One of those situations
1040         is when we have set an override width; this only affects for now to flex
1041         and grid items. We also follow this approach when setting the logical
1042         width based on the restrictions of 'auto' value in the 'min-width'
1043         property.
1044
1045         This behavior is not correct, since there is no reason to avoid
1046         computing this margins, in the general case. I think this logic was
1047         designed as an optimization for flexbox, which was already computing
1048         the margins by its own, but it's not applicable in the general case, so
1049         grid needs these margins to be computed properly.
1050
1051         For the shrink-to-fit behavior we can add some grid related logic to the
1052         already defined RenderBox function "sizesLogicalWidthToFitContent",
1053         so we avoid the override width.
1054
1055         Tests: fast/css-grid-layout/grid-item-auto-sized-align-justify-margin-border-padding.html
1056                fast/css-grid-layout/min-width-height-auto-and-margins.html
1057
1058         * rendering/RenderBox.cpp:
1059         (WebCore::RenderBox::computeLogicalWidthInRegion):
1060         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1061         * rendering/RenderGrid.cpp:
1062         (WebCore::defaultAlignmentChangedFromStretchInRowAxis):
1063         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
1064         (WebCore::RenderGrid::styleDidChange):
1065         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
1066         (WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted.
1067         (WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
1068         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching): Deleted.
1069
1070 2015-11-18  Aaron Chu  <arona.chu@gmail.com>
1071
1072         AX: Shadow DOM video player controls menus need aria-owns on the trigger buttons
1073         https://bugs.webkit.org/show_bug.cgi?id=127065
1074
1075         Reviewed by Darin Adler.
1076
1077         Test: media/accessibility-closed-captions-has-aria-owns.html
1078
1079         * Modules/mediacontrols/mediaControlsApple.js:
1080         (Controller.prototype.createControls):
1081         (Controller.prototype.buildCaptionMenu):
1082         * Modules/mediacontrols/mediaControlsBase.js:
1083         (Controller.prototype.createControls):
1084         (Controller.prototype.buildCaptionMenu):
1085
1086 2015-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1087
1088         Null dereference loading Blink layout test editing/execCommand/indent-button-crash.html
1089         https://bugs.webkit.org/show_bug.cgi?id=151187
1090
1091         Reviewed by Darin Adler.
1092
1093         This is a merge of Blink r174671:
1094         https://codereview.chromium.org/291143002
1095
1096         Fixes imported/blink/editing/execCommand/indent-button-crash.html.
1097
1098         * editing/ApplyBlockElementCommand.cpp:
1099         (WebCore::ApplyBlockElementCommand::doApply):
1100
1101 2015-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1102
1103         REGRESSION(r192459): [GTK] User agent string is broken after r192459
1104         https://bugs.webkit.org/show_bug.cgi?id=151347
1105
1106         Reviewed by Žan Doberšek.
1107
1108         Remove the incorrect macro and simply use the given values
1109         USER_AGENT_GTK_MAJOR_VERSION and USER_AGENT_GTK_MINOR_VERSION that
1110         are now strings.
1111
1112         * platform/gtk/UserAgentGtk.cpp:
1113         (WebCore::versionForUAString):
1114         (WebCore::buildUserAgentString):
1115
1116 2015-11-17  Zalan Bujtas  <zalan@apple.com>
1117
1118         Simple line layout: Add letter-spacing support.
1119         https://bugs.webkit.org/show_bug.cgi?id=151362
1120
1121         Reviewed by Antti Koivisto.
1122
1123         This enables us to use simple line layout on letter-spacing content.
1124         (fixme: webkit.org/b/151368 -> Repaint rect is not computed correctly when negative letter-spacing applied)
1125
1126         Test: fast/text/simple-line-letterspacing.html
1127
1128         * rendering/SimpleLineLayout.cpp:
1129         (WebCore::SimpleLineLayout::canUseForStyle):
1130         * rendering/SimpleLineLayoutFunctions.cpp:
1131         (WebCore::SimpleLineLayout::paintFlow): RenderLineBoxList tests vertical intersection only. 
1132         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1133         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
1134
1135 2015-11-17  Per Arne Vollan  <peavo@outlook.com>
1136
1137         [WinCairo][MediaFoundation] Current playback time is not shown.
1138         https://bugs.webkit.org/show_bug.cgi?id=151357
1139
1140         Reviewed by Alex Christensen.
1141
1142         We need to implement the currentTime() method.
1143
1144         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1145         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
1146         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
1147         (WebCore::MediaPlayerPrivateMediaFoundation::paused):
1148         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::paintCurrentFrame):
1149         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
1150         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
1151         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1152
1153 2015-11-17  Zalan Bujtas  <zalan@apple.com>
1154
1155         Split SimpleLineLayout::canUseFor into canUseForStyle and canUseForFontAndText.
1156         https://bugs.webkit.org/show_bug.cgi?id=151338
1157
1158         Reviewed by Myles C. Maxfield.
1159
1160         No change in functionality.
1161
1162         * rendering/SimpleLineLayout.cpp:
1163         (WebCore::SimpleLineLayout::canUseForFontAndText):
1164         (WebCore::SimpleLineLayout::canUseForStyle):
1165         (WebCore::SimpleLineLayout::canUseFor):
1166
1167 2015-11-17  Brady Eidson  <beidson@apple.com>
1168
1169         Modern IDB: Support IDBObjectStore.indexNames.
1170         https://bugs.webkit.org/show_bug.cgi?id=151341
1171
1172         Reviewed by Alex Christensen.
1173
1174         No new tests (Covered by existing storage/indexeddb/modern/objectstore-attributes.html).
1175
1176         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1177         (WebCore::IDBClient::IDBObjectStore::indexNames):
1178         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1179         (WebCore::IDBObjectStoreInfo::indexNames):
1180         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1181
1182 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
1183
1184         ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
1185         https://bugs.webkit.org/show_bug.cgi?id=151025
1186
1187         Reviewed by Darin Adler.
1188
1189         Negative margins could make RenderFlexibleBox compute negative
1190         intrinsic sizes. Clamp intrinsic sizes to 0.
1191
1192         Test: css3/flexbox/negative-margins-assert.html
1193
1194         * rendering/RenderFlexibleBox.cpp:
1195         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1196
1197 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
1198
1199         [css-grid] Fix alignment with gutters and negative free spaces
1200         https://bugs.webkit.org/show_bug.cgi?id=151307
1201
1202         Reviewed by Zalan Bujtas.
1203
1204         This is a regression caused by r192154. The problem was that
1205         the free space was not properly computed when the grid
1206         container was narrower than the track sizes + gutters size for
1207         a given axis. The culprit was an unneeded clamp to 0 which was
1208         polluting the freeSpace computation as the track sizing
1209         algorithm works perfectly OK with negative freeSpace values.
1210
1211         * rendering/RenderGrid.cpp:
1212         (WebCore::RenderGrid::computeTrackSizesForDirection):
1213
1214 2015-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1215
1216         [GStreamer] Use RunLoop instead of GMainLoop in AudioFileReaderGStreamer
1217         https://bugs.webkit.org/show_bug.cgi?id=151256
1218
1219         Reviewed by Žan Doberšek.
1220
1221         Use RunLoop instead of the platform specific code. The AudioBus
1222         can be created from any thread, so we create a helper thread to
1223         ensure we don't use the main RunLoop.
1224
1225         This patch also includes some code cleanups:
1226           - Uses smart pointers when possible.
1227           - Fixes uninitialized members in constructors.
1228           - Makes private members private.
1229           - Uses lambdas instead of static non-members functions.
1230           - nullptr instead of 0 in some places.
1231
1232         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1233         (WebCore::AudioFileReader::createWeakPtr):
1234         (WebCore::AudioFileReader::deinterleavePadAddedCallback):
1235         (WebCore::AudioFileReader::deinterleaveReadyCallback):
1236         (WebCore::AudioFileReader::decodebinPadAddedCallback):
1237         (WebCore::AudioFileReader::AudioFileReader):
1238         (WebCore::AudioFileReader::~AudioFileReader):
1239         (WebCore::AudioFileReader::handleSample):
1240         (WebCore::AudioFileReader::handleMessage):
1241         (WebCore::AudioFileReader::handleNewDeinterleavePad):
1242         (WebCore::AudioFileReader::deinterleavePadsConfigured):
1243         (WebCore::AudioFileReader::plugDeinterleave):
1244         (WebCore::AudioFileReader::decodeAudioForBusCreation):
1245         (WebCore::AudioFileReader::createBus):
1246         (WebCore::createBusFromAudioFile):
1247         (WebCore::createBusFromInMemoryAudioFile):
1248         (WebCore::onAppsinkPullRequiredCallback): Deleted.
1249         (WebCore::messageCallback): Deleted.
1250         (WebCore::onGStreamerDeinterleavePadAddedCallback): Deleted.
1251         (WebCore::onGStreamerDeinterleaveReadyCallback): Deleted.
1252         (WebCore::onGStreamerDecodebinPadAddedCallback): Deleted.
1253         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
1254         (WTF::adoptGRef):
1255         (WTF::refGPtr<GstBufferList>):
1256         (WTF::derefGPtr<GstBufferList>):
1257         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
1258
1259 2015-11-16  Eric Carlson  <eric.carlson@apple.com>
1260
1261         [MediaStream] VideoTrack should respond to MediaStreamTrack state changes
1262         https://bugs.webkit.org/show_bug.cgi?id=151299
1263
1264         Reviewed by Jer Noble.
1265
1266         Test: fast/mediastream/MediaStream-video-element-track-stop.html
1267
1268         * Modules/mediastream/MediaStreamTrack.cpp:
1269         (WebCore::MediaStreamTrack::ended): Check m_ended.
1270         (WebCore::MediaStreamTrack::stopProducingData): Set m_ended before telling private track to 
1271           stop so we won't fire an 'ended' event.
1272         (WebCore::MediaStreamTrack::trackEnded): Set m_ended, add comments from spec.
1273         * Modules/mediastream/MediaStreamTrack.h:
1274
1275         * html/HTMLMediaElement.cpp:
1276         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Live streams have infinite duration,
1277           not indefinite.
1278
1279         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1280         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1281         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Return NULL when displayMode
1282           is None.
1283         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Calculate current 
1284           displayMode based on MediaStream state.
1285         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Renamed from 
1286           setPausedImageVisible, use m_displayMode. Don't start/stop clock, it makes more sense
1287           to do that in play and pause.
1288         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Start clock. 
1289         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Stop clock.
1290         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): Call updateDisplayMode.
1291         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeStatusChanged): Ditto.
1292         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize):
1293         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Always try to create
1294           both layers if necessary.
1295         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::renderingModeChanged): New, update displayMode
1296           and call back to the media element.
1297         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
1298         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Get rid of some unused locals.
1299           React to a change in the enabled video track.
1300         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Paint black when
1301           the active video track is disabled.
1302         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPausedImageVisible): Deleted.
1303
1304         * platform/mediastream/MediaStreamPrivate.cpp:
1305         (WebCore::MediaStreamPrivate::updateActiveState): Split the logic of updating the active video
1306           track out into updateActiveVideoTrack.
1307         (WebCore::MediaStreamPrivate::hasVideo): Check for track.ended.
1308         (WebCore::MediaStreamPrivate::hasAudio): Ditto.
1309         (WebCore::MediaStreamPrivate::paintCurrentFrameInContext): Don't call the source directly.
1310         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): New.
1311         (WebCore::MediaStreamPrivate::trackEnabledChanged): Call updateActiveVideoTrack.
1312         (WebCore::MediaStreamPrivate::trackEnded): new.
1313         * platform/mediastream/MediaStreamPrivate.h:
1314
1315         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1316         (WebCore::MediaStreamTrackPrivate::setEnabled): Call observers if enabled state changes.
1317         (WebCore::MediaStreamTrackPrivate::endTrack): Call observers.
1318         (WebCore::MediaStreamTrackPrivate::paintCurrentFrameInContext): New.
1319         (WebCore::MediaStreamTrackPrivate::preventSourceFromStopping): Add comments.
1320         * platform/mediastream/MediaStreamTrackPrivate.h:
1321
1322         * platform/mock/MockRealtimeVideoSource.cpp:
1323         (WebCore::MockRealtimeVideoSource::paintCurrentFrameInContext): Remove a commented-out line.
1324
1325 2015-11-16  Pranjal Jumde  <pjumde@apple.com>
1326
1327         Fixes the buffer-overflow when reading characters from textRun
1328         https://bugs.webkit.org/attachment.cgi?bugid=151055
1329         <rdar://problem/23251789>
1330
1331         Reviewed by Brent Fulgham.
1332
1333         * platform/graphics/FontCascade.cpp
1334
1335 2015-11-16  Brady Eidson  <beidson@apple.com>
1336
1337         Modern IDB:Make in-memory ObjectStore cursors work.
1338         https://bugs.webkit.org/show_bug.cgi?id=151196
1339
1340         Reviewed by Darin Adler.
1341
1342         Tests: storage/indexeddb/modern/cursor-2.html
1343                storage/indexeddb/modern/cursor-3.html
1344                storage/indexeddb/modern/cursor-4.html
1345                storage/indexeddb/modern/cursor-5.html
1346                storage/indexeddb/modern/cursor-6.html
1347                storage/indexeddb/modern/cursor-7.html
1348                storage/indexeddb/modern/cursor-8.html
1349                storage/indexeddb/modern/objectstore-cursor-advance-failures.html
1350                storage/indexeddb/modern/objectstore-cursor-continue-failures.html
1351
1352         Object store cursors directly hold on to a std::set<>::iterator to act as the cursor.
1353         
1354         The object store tells all of its cursors when it is cleared or records are deleted
1355         so the cursors can invalidate their iterators as needed.
1356         
1357         In case of such invalidation, the cursor hangs on to the current key value so it can 
1358         pick up where it left off in case it is iterated.
1359
1360         * CMakeLists.txt:
1361         * WebCore.xcodeproj/project.pbxproj:
1362
1363         * Modules/indexeddb/IDBGetResult.h:
1364         (WebCore::IDBGetResult::isolatedCopy):
1365         
1366         * Modules/indexeddb/IDBKeyRangeData.cpp:
1367         (WebCore::IDBKeyRangeData::containsKey):
1368         (WebCore::IDBKeyRangeData::loggingString):
1369         * Modules/indexeddb/IDBKeyRangeData.h:
1370         
1371         * Modules/indexeddb/client/IDBAnyImpl.cpp:
1372         (WebCore::IDBClient::IDBAny::modernIDBCursor):
1373         
1374         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1375         (WebCore::IDBClient::IDBCursor::update):
1376         (WebCore::IDBClient::IDBCursor::advance):
1377         (WebCore::IDBClient::IDBCursor::continueFunction):
1378         (WebCore::IDBClient::IDBCursor::setGetResult):
1379         * Modules/indexeddb/client/IDBCursorImpl.h:
1380         
1381         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1382         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1383         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
1384         * Modules/indexeddb/client/IDBRequestImpl.h:
1385         (WebCore::IDBClient::IDBRequest::pendingCursor):
1386         
1387         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1388         (WebCore::IDBClient::IDBTransaction::addRequest): Deleted.
1389         
1390         * Modules/indexeddb/client/TransactionOperation.cpp:
1391         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
1392         * Modules/indexeddb/client/TransactionOperation.h:
1393         (WebCore::IDBClient::TransactionOperation::cursorIdentifier):
1394         
1395         * Modules/indexeddb/server/IDBBackingStore.h:
1396         
1397         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1398         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
1399         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
1400         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1401         
1402         * Modules/indexeddb/server/MemoryCursor.cpp: Added.
1403         (WebCore::IDBServer::cursorMap):
1404         (WebCore::IDBServer::MemoryCursor::MemoryCursor):
1405         (WebCore::IDBServer::MemoryCursor::~MemoryCursor):
1406         (WebCore::IDBServer::MemoryCursor::cursorForIdentifier):
1407         * Modules/indexeddb/server/MemoryCursor.h: Added.
1408         
1409         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1410         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
1411         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
1412         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1413         
1414         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1415         (WebCore::IDBServer::MemoryObjectStore::clear):
1416         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
1417         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
1418         (WebCore::IDBServer::MemoryObjectStore::addRecord):
1419         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
1420         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForDeleteRecord):
1421         (WebCore::IDBServer::MemoryObjectStore::maybeOpenCursor):
1422         * Modules/indexeddb/server/MemoryObjectStore.h:
1423         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
1424         
1425         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: Added.
1426         (WebCore::IDBServer::MemoryObjectStoreCursor::create):
1427         (WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor):
1428         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
1429         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
1430         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
1431         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
1432         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange):
1433         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange):
1434         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
1435         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1436         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1437         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition):
1438         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
1439         * Modules/indexeddb/server/MemoryObjectStoreCursor.h: Added.
1440
1441         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1442         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
1443         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
1444         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1445
1446         * Modules/indexeddb/shared/IDBCursorInfo.h:
1447         (WebCore::IDBCursorInfo::range):
1448
1449         * Modules/indexeddb/shared/IDBRequestData.cpp:
1450         (WebCore::IDBRequestData::IDBRequestData):
1451         (WebCore::IDBRequestData::cursorIdentifier):
1452         * Modules/indexeddb/shared/IDBRequestData.h:
1453
1454 2015-11-16  Anders Carlsson  <andersca@apple.com>
1455
1456         Add identifier strings for a bunch of context menu items
1457         https://bugs.webkit.org/show_bug.cgi?id=151272
1458
1459         Reviewed by Dan Bernstein.
1460
1461         Have NSMenuItem conform to NSUserInterfaceItemIdentification.
1462
1463         * platform/spi/mac/NSMenuSPI.h:
1464
1465 2015-11-16  Jiewen Tan  <jiewen_tan@apple.com>
1466
1467         Null-pointer dereference in WebCore::firstEditablePositionAfterPositionInRoot
1468         https://bugs.webkit.org/show_bug.cgi?id=151288
1469         <rdar://problem/23450367>
1470
1471         Reviewed by Darin Adler.
1472
1473         Some problematic organization of body element could cause problems to JustifyRight
1474         and Indent commnads.
1475
1476         Tests: editing/execCommand/justify-right-then-indent-with-problematic-body.html
1477                editing/execCommand/justify-right-with-problematic-body.html
1478
1479         * editing/CompositeEditCommand.cpp:
1480         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1481         Assertion at l1017 is not held anymore with the testcase:
1482         editing/execCommand/justify-right-with-problematic-body.html.
1483         Therefore, change it to an if statement.
1484         Also, add a guardance before calling insertNewDefaultParagraphElementAt()
1485         as insertNodeAt() requires an editable position.
1486         (WebCore::CompositeEditCommand::moveParagraphWithClones):
1487         Add a guardance before calling insertNodeAt() as it requires an editable position.
1488         * editing/htmlediting.cpp:
1489         (WebCore::firstEditablePositionAfterPositionInRoot):
1490         (WebCore::lastEditablePositionBeforePositionInRoot):
1491
1492 2015-11-16  Simon Fraser  <simon.fraser@apple.com>
1493
1494         Sort the Xcode project files.
1495
1496         * WebCore.xcodeproj/project.pbxproj:
1497
1498 2015-11-16  Sebastian Dröge  <sebastian@centricular.com>
1499
1500         WebRTC: Expose RTCPeerConnectionInternals functions to JS builtins.
1501         https://bugs.webkit.org/show_bug.cgi?id=151302
1502
1503         Reviewed by Youenn Fablet.
1504
1505         * bindings/js/JSDOMWindowBase.cpp:
1506         (WebCore::JSDOMWindowBase::finishCreation):
1507         Expose RTCPeerConnectionInternals functions to JS builtins.
1508
1509 2015-11-16  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1510
1511         [Streams API] Update the implementation up to spec of Nov 11 2015
1512         https://bugs.webkit.org/show_bug.cgi?id=151195
1513
1514         Reviewed by Youenn Fablet.
1515
1516         Updated the implementation of Readable and Writable Streams to the latest changes in the spec. Main changes are
1517         the removal of the error and the state from the reader, readers are not automatically released and then minor or
1518         style changes.
1519
1520         Implementation is up to date with version
1521         https://github.com/whatwg/streams/commit/48c8a3c30ea7e76c5e4eb9f157a438dd755bcc8e.
1522
1523         Tests: streams/reference-implementation/readable-stream-templated.html
1524                streams/reference-implementation/readable-stream-reader.html
1525
1526         * Modules/streams/ReadableStream.js:
1527         (getReader): Removed check for locked stream.
1528         * Modules/streams/ReadableStreamInternals.js:
1529         (privateInitializeReadableStreamReader): Removed setting @error and @state and initialized owner and owner's
1530         reader as per spec.
1531         (teeReadableStreamPullFunction): Added assertions.
1532         (isReadableStreamReader): Added comment about resetting the reader owner to null instead of undefined as a means
1533         to distinguish between not having the slot and having it unset.
1534         (finishClosingReadableStream): Inline @closeReadableStreamReader as it is used only here now.
1535         (readFromReadableStreamReader): Reworked the state and error to use the stream one and changed the conditions to
1536         pull again as per spec.
1537         (errorReadableStream): Not releasing the reader and removed the reader error and state management.
1538         (releaseReadableStreamReader): Deleted.
1539         (closeReadableStreamReader): Deleted.
1540         * Modules/streams/ReadableStreamReader.js:
1541         (cancel): Removed some checks and assertions as per spec.
1542         (read): Added check for owner.
1543         (releaseLock): No closing the reader and rejecting close promise and unlinking reader and owner instead.
1544         * Modules/streams/WritableStream.js:
1545         (abort): Style change.
1546         * Modules/streams/WritableStreamInternals.js:
1547         (writableStreamAdvanceQueue):
1548         (closeWritableStream): Used @call instead of @apply.
1549
1550 2015-11-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1551
1552         WebRTC: Update RTCPeerConnection API and introduce PeerConnectionBackend
1553         https://bugs.webkit.org/show_bug.cgi?id=150166
1554
1555         Reviewed by Eric Carlson and Youenn Fablet
1556
1557         This change introduces PeerConnectionBackend which is a WebCore interface
1558         that allows RTCPeerConnection to have platform abstractions at different
1559         levels. For example, the MediaEndpoint interface [1] is a lower level
1560         WebRTC backend abstraction where a big part of the WebRTC specification
1561         is implemented in WebCore to be reusable. RTCPeerConnectionHandler (in
1562         the repo today) is on the other hand a higher level WebRTC backend
1563         abstraction where the calls are mostly forwarded directly to the
1564         backend. The PeerConnectionBackend interface facilitates both approaches.
1565
1566         RTCPeerConnection
1567          | (has)
1568          |
1569         PeerConnectionBackend
1570          |   |
1571          |   | (realizes)
1572          |  MediaEndpointPeerConnection
1573          |   | (has)
1574          |   |
1575          |  MediaEndpoint (platform interface)
1576          |
1577          | (realizes)
1578         RTCPeerHandlerPeerConnection
1579          | (has)
1580          |
1581         RCPeerConnectionHandler (existing platform interface)
1582
1583         Notable changes:
1584
1585         # Overloaded methods on RTCPeerConnection (Promise + legacy callback
1586         signatures) are implemented with JSBuiltins.
1587
1588         # "Queued operations" ([1] Section 4.3.1) is implemented in JS bindings
1589         with Promises.
1590
1591         # New RTCPeerConnection features
1592          - add/removeTrack()
1593          - pending/currentLocal/RemoteDescription attributes
1594          - RTCRtpSender/Receiver
1595
1596         # Information carrying objects like RTCSessionDescription and
1597         RTCCandidate don't encapsulate a "mirrored" platform object anymore.
1598
1599         # Remove RTCPeerConnection specific callback implementations (not used
1600         with JS bindings)
1601
1602         [1] http://webkit.org/b/150165
1603         [2] https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html
1604
1605         Tests: Mock should be added to test future WebRTC backend abstractions.
1606
1607         * CMakeLists.txt:
1608         * DerivedSources.make:
1609         * Modules/mediastream/PeerConnectionBackend.cpp: Added.
1610         (WebCore::createPeerConnectionBackend):
1611         * Modules/mediastream/PeerConnectionBackend.h: Added.
1612         (WebCore::PeerConnectionBackendClient::~PeerConnectionBackendClient):
1613         (WebCore::PeerConnectionBackend::~PeerConnectionBackend):
1614         * Modules/mediastream/PeerConnectionStates.h: Added.
1615         * Modules/mediastream/RTCConfiguration.cpp: Added.
1616         (WebCore::validateIceServerURL):
1617         (WebCore::parseIceServer):
1618         (WebCore::RTCConfiguration::create):
1619         (WebCore::RTCConfiguration::RTCConfiguration):
1620         (WebCore::RTCConfiguration::initialize):
1621         * Modules/mediastream/RTCConfiguration.h:
1622         (WebCore::RTCConfiguration::iceTransportPolicy):
1623         (WebCore::RTCConfiguration::bundlePolicy):
1624         (WebCore::RTCConfiguration::iceServers):
1625         (WebCore::RTCConfiguration::create): Deleted.
1626         (WebCore::RTCConfiguration::appendServer): Deleted.
1627         (WebCore::RTCConfiguration::numberOfServers): Deleted.
1628         (WebCore::RTCConfiguration::server): Deleted.
1629         (WebCore::RTCConfiguration::iceTransports): Deleted.
1630         (WebCore::RTCConfiguration::setIceTransports): Deleted.
1631         (WebCore::RTCConfiguration::requestIdentity): Deleted.
1632         (WebCore::RTCConfiguration::setRequestIdentity): Deleted.
1633         (WebCore::RTCConfiguration::privateConfiguration): Deleted.
1634         (WebCore::RTCConfiguration::RTCConfiguration): Deleted.
1635         * Modules/mediastream/RTCConfiguration.idl:
1636         * Modules/mediastream/RTCIceCandidate.cpp:
1637         (WebCore::RTCIceCandidate::create):
1638         (WebCore::RTCIceCandidate::RTCIceCandidate):
1639         (WebCore::RTCIceCandidate::~RTCIceCandidate): Deleted.
1640         (WebCore::RTCIceCandidate::candidate): Deleted.
1641         (WebCore::RTCIceCandidate::sdpMid): Deleted.
1642         (WebCore::RTCIceCandidate::sdpMLineIndex): Deleted.
1643         (WebCore::RTCIceCandidate::descriptor): Deleted.
1644         * Modules/mediastream/RTCIceCandidate.h:
1645         (WebCore::RTCIceCandidate::~RTCIceCandidate):
1646         (WebCore::RTCIceCandidate::candidate):
1647         (WebCore::RTCIceCandidate::setCandidate):
1648         (WebCore::RTCIceCandidate::sdpMid):
1649         (WebCore::RTCIceCandidate::setSdpMid):
1650         (WebCore::RTCIceCandidate::sdpMLineIndex):
1651         (WebCore::RTCIceCandidate::setSdpMLineIndex):
1652         * Modules/mediastream/RTCIceCandidate.idl:
1653         * Modules/mediastream/RTCIceCandidateEvent.cpp:
1654         (WebCore::RTCIceCandidateEvent::create):
1655         (WebCore::RTCIceCandidateEvent::RTCIceCandidateEvent):
1656         * Modules/mediastream/RTCIceCandidateEvent.h:
1657         * Modules/mediastream/RTCIceServer.h:
1658         (WebCore::RTCIceServer::urls):
1659         (WebCore::RTCIceServer::credential):
1660         (WebCore::RTCIceServer::username):
1661         (WebCore::RTCIceServer::RTCIceServer):
1662         (WebCore::RTCIceServer::create): Deleted.
1663         (WebCore::RTCIceServer::privateServer): Deleted.
1664         * Modules/mediastream/RTCOfferAnswerOptions.cpp:
1665         (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions):
1666         (WebCore::RTCOfferAnswerOptions::initialize):
1667         (WebCore::RTCOfferOptions::RTCOfferOptions):
1668         (WebCore::RTCOfferOptions::initialize):
1669         (WebCore::RTCAnswerOptions::create):
1670         (WebCore::RTCAnswerOptions::initialize):
1671         (WebCore::RTCOfferAnswerOptions::create): Deleted.
1672         * Modules/mediastream/RTCOfferAnswerOptions.h:
1673         (WebCore::RTCOfferAnswerOptions::voiceActivityDetection):
1674         (WebCore::RTCOfferOptions::offerToReceiveVideo):
1675         (WebCore::RTCOfferOptions::offerToReceiveAudio):
1676         (WebCore::RTCOfferOptions::iceRestart):
1677         (WebCore::RTCAnswerOptions::RTCAnswerOptions):
1678         (WebCore::RTCOfferAnswerOptions::requestIdentity): Deleted.
1679         (WebCore::RTCOfferAnswerOptions::privateOfferAnswerOptions): Deleted.
1680         (WebCore::RTCOfferAnswerOptions::RTCOfferAnswerOptions): Deleted.
1681         (WebCore::RTCOfferOptions::voiceActivityDetection): Deleted.
1682         (WebCore::RTCOfferOptions::privateOfferOptions): Deleted.
1683         (WebCore::RTCOfferOptions::~RTCOfferOptions): Deleted.
1684         (WebCore::RTCOfferOptions::RTCOfferOptions): Deleted.
1685         * Modules/mediastream/RTCPeerConnection.cpp:
1686         (WebCore::RTCPeerConnection::create):
1687         (WebCore::RTCPeerConnection::RTCPeerConnection):
1688         (WebCore::RTCPeerConnection::getSenders):
1689         (WebCore::RTCPeerConnection::getReceivers):
1690         (WebCore::RTCPeerConnection::addTrack):
1691         (WebCore::RTCPeerConnection::removeTrack):
1692         (WebCore::RTCPeerConnection::queuedCreateOffer):
1693         (WebCore::RTCPeerConnection::queuedCreateAnswer):
1694         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
1695         (WebCore::RTCPeerConnection::localDescription):
1696         (WebCore::RTCPeerConnection::currentLocalDescription):
1697         (WebCore::RTCPeerConnection::pendingLocalDescription):
1698         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
1699         (WebCore::RTCPeerConnection::remoteDescription):
1700         (WebCore::RTCPeerConnection::currentRemoteDescription):
1701         (WebCore::RTCPeerConnection::pendingRemoteDescription):
1702         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
1703         (WebCore::RTCPeerConnection::signalingState):
1704         (WebCore::RTCPeerConnection::iceGatheringState):
1705         (WebCore::RTCPeerConnection::iceConnectionState):
1706         (WebCore::RTCPeerConnection::setConfiguration):
1707         (WebCore::RTCPeerConnection::privateGetStats):
1708         (WebCore::RTCPeerConnection::createDataChannel):
1709         (WebCore::RTCPeerConnection::close):
1710         (WebCore::RTCPeerConnection::stop):
1711         (WebCore::RTCPeerConnection::setSignalingState):
1712         (WebCore::RTCPeerConnection::updateIceGatheringState):
1713         (WebCore::RTCPeerConnection::updateIceConnectionState):
1714         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
1715         (WebCore::RTCPeerConnection::fireEvent):
1716         (WebCore::validateIceServerURL): Deleted.
1717         (WebCore::processIceServer): Deleted.
1718         (WebCore::RTCPeerConnection::parseConfiguration): Deleted.
1719         (WebCore::RTCPeerConnection::~RTCPeerConnection): Deleted.
1720         (WebCore::RTCPeerConnection::createOffer): Deleted.
1721         (WebCore::RTCPeerConnection::createAnswer): Deleted.
1722         (WebCore::RTCPeerConnection::checkStateForLocalDescription): Deleted.
1723         (WebCore::RTCPeerConnection::checkStateForRemoteDescription): Deleted.
1724         (WebCore::RTCPeerConnection::setLocalDescription): Deleted.
1725         (WebCore::RTCPeerConnection::setRemoteDescription): Deleted.
1726         (WebCore::RTCPeerConnection::updateIce): Deleted.
1727         (WebCore::RTCPeerConnection::addIceCandidate): Deleted.
1728         (WebCore::RTCPeerConnection::addStream): Deleted.
1729         (WebCore::RTCPeerConnection::removeStream): Deleted.
1730         (WebCore::RTCPeerConnection::getLocalStreams): Deleted.
1731         (WebCore::RTCPeerConnection::getRemoteStreams): Deleted.
1732         (WebCore::RTCPeerConnection::getStreamById): Deleted.
1733         (WebCore::RTCPeerConnection::getStats): Deleted.
1734         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId): Deleted.
1735         (WebCore::RTCPeerConnection::createDTMFSender): Deleted.
1736         (WebCore::RTCPeerConnection::negotiationNeeded): Deleted.
1737         (WebCore::RTCPeerConnection::didGenerateIceCandidate): Deleted.
1738         (WebCore::RTCPeerConnection::didChangeSignalingState): Deleted.
1739         (WebCore::RTCPeerConnection::didChangeIceGatheringState): Deleted.
1740         (WebCore::RTCPeerConnection::didChangeIceConnectionState): Deleted.
1741         (WebCore::RTCPeerConnection::didAddRemoteStream): Deleted.
1742         (WebCore::RTCPeerConnection::didRemoveRemoteStream): Deleted.
1743         (WebCore::RTCPeerConnection::didAddRemoteDataChannel): Deleted.
1744         (WebCore::RTCPeerConnection::didAddOrRemoveTrack): Deleted.
1745         (WebCore::RTCPeerConnection::changeSignalingState): Deleted.
1746         (WebCore::RTCPeerConnection::changeIceGatheringState): Deleted.
1747         (WebCore::RTCPeerConnection::changeIceConnectionState): Deleted.
1748         (WebCore::RTCPeerConnection::scheduleDispatchEvent): Deleted.
1749         (WebCore::RTCPeerConnection::scheduledEventTimerFired): Deleted.
1750         * Modules/mediastream/RTCPeerConnection.h:
1751         * Modules/mediastream/RTCPeerConnection.idl:
1752         * Modules/mediastream/RTCPeerConnection.js: Added.
1753         (createOffer):
1754         (createAnswer):
1755         (setLocalDescription):
1756         (setRemoteDescription):
1757         (addIceCandidate):
1758         (getStats):
1759         * Modules/mediastream/RTCPeerConnectionErrorCallback.h:
1760         (WebCore::RTCPeerConnectionErrorCallback::~RTCPeerConnectionErrorCallback): Deleted.
1761         * Modules/mediastream/RTCPeerConnectionInternals.js: Added.
1762         (runNext):
1763         (enqueueOperation):
1764         (setLocalOrRemoteDescription):
1765         (extractCallbackArg):
1766         * Modules/mediastream/RTCRtpReceiver.cpp: Added.
1767         (WebCore::RTCRtpReceiver::RTCRtpReceiver):
1768         * Modules/mediastream/RTCRtpReceiver.h: Added.
1769         (WebCore::RTCRtpReceiver::create):
1770         * Modules/mediastream/RTCRtpReceiver.idl: Added.
1771         * Modules/mediastream/RTCRtpSender.cpp: Added.
1772         (WebCore::RTCRtpSender::RTCRtpSender):
1773         * Modules/mediastream/RTCRtpSender.h: Added.
1774         (WebCore::RTCRtpSender::create):
1775         (WebCore::RTCRtpSender::mediaStreamId):
1776         * Modules/mediastream/RTCRtpSender.idl: Added.
1777         * Modules/mediastream/RTCRtpSenderReceiverBase.h: Added.
1778         (WebCore::RTCRtpSenderReceiverBase::~RTCRtpSenderReceiverBase):
1779         (WebCore::RTCRtpSenderReceiverBase::track):
1780         (WebCore::RTCRtpSenderReceiverBase::RTCRtpSenderReceiverBase):
1781         * Modules/mediastream/RTCSessionDescription.cpp:
1782         (WebCore::RTCSessionDescription::create):
1783         (WebCore::RTCSessionDescription::RTCSessionDescription):
1784         (WebCore::RTCSessionDescription::setType):
1785         (WebCore::RTCSessionDescription::~RTCSessionDescription): Deleted.
1786         (WebCore::RTCSessionDescription::type): Deleted.
1787         (WebCore::RTCSessionDescription::sdp): Deleted.
1788         (WebCore::RTCSessionDescription::setSdp): Deleted.
1789         (WebCore::RTCSessionDescription::descriptor): Deleted.
1790         * Modules/mediastream/RTCSessionDescription.h:
1791         (WebCore::RTCSessionDescription::~RTCSessionDescription):
1792         (WebCore::RTCSessionDescription::type):
1793         (WebCore::RTCSessionDescription::sdp):
1794         (WebCore::RTCSessionDescription::setSdp):
1795         * Modules/mediastream/RTCSessionDescriptionCallback.h:
1796         (WebCore::RTCSessionDescriptionCallback::~RTCSessionDescriptionCallback): Deleted.
1797         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp: Removed.
1798         (WebCore::RTCSessionDescriptionRequestImpl::create): Deleted.
1799         (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl): Deleted.
1800         (WebCore::RTCSessionDescriptionRequestImpl::~RTCSessionDescriptionRequestImpl): Deleted.
1801         (WebCore::RTCSessionDescriptionRequestImpl::requestSucceeded): Deleted.
1802         (WebCore::RTCSessionDescriptionRequestImpl::requestFailed): Deleted.
1803         (WebCore::RTCSessionDescriptionRequestImpl::stop): Deleted.
1804         (WebCore::RTCSessionDescriptionRequestImpl::activeDOMObjectName): Deleted.
1805         (WebCore::RTCSessionDescriptionRequestImpl::canSuspendForPageCache): Deleted.
1806         (WebCore::RTCSessionDescriptionRequestImpl::clear): Deleted.
1807         * Modules/mediastream/RTCSessionDescriptionRequestImpl.h: Removed.
1808         * Modules/mediastream/RTCStatsCallback.h: Removed.
1809         (WebCore::RTCStatsCallback::~RTCStatsCallback): Deleted.
1810         * Modules/mediastream/RTCStatsCallback.idl: Removed.
1811         * Modules/mediastream/RTCStatsRequestImpl.cpp: Removed.
1812         (WebCore::RTCStatsRequestImpl::create): Deleted.
1813         (WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl): Deleted.
1814         (WebCore::RTCStatsRequestImpl::~RTCStatsRequestImpl): Deleted.
1815         (WebCore::RTCStatsRequestImpl::createResponse): Deleted.
1816         (WebCore::RTCStatsRequestImpl::hasSelector): Deleted.
1817         (WebCore::RTCStatsRequestImpl::track): Deleted.
1818         (WebCore::RTCStatsRequestImpl::requestSucceeded): Deleted.
1819         (WebCore::RTCStatsRequestImpl::requestFailed): Deleted.
1820         (WebCore::RTCStatsRequestImpl::stop): Deleted.
1821         (WebCore::RTCStatsRequestImpl::activeDOMObjectName): Deleted.
1822         (WebCore::RTCStatsRequestImpl::canSuspendForPageCache): Deleted.
1823         (WebCore::RTCStatsRequestImpl::clear): Deleted.
1824         * Modules/mediastream/RTCStatsRequestImpl.h: Removed.
1825         * Modules/mediastream/RTCTrackEvent.cpp: Added.
1826         (WebCore::RTCTrackEventInit::RTCTrackEventInit):
1827         (WebCore::RTCTrackEvent::create):
1828         (WebCore::RTCTrackEvent::RTCTrackEvent):
1829         * Modules/mediastream/RTCTrackEvent.h: Added.
1830         (WebCore::RTCTrackEvent::receiver):
1831         (WebCore::RTCTrackEvent::track):
1832         (WebCore::RTCTrackEvent::eventInterface):
1833         * Modules/mediastream/RTCTrackEvent.idl: Added.
1834         * Modules/mediastream/RTCVoidRequestImpl.cpp: Removed.
1835         (WebCore::RTCVoidRequestImpl::create): Deleted.
1836         (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl): Deleted.
1837         (WebCore::RTCVoidRequestImpl::~RTCVoidRequestImpl): Deleted.
1838         (WebCore::RTCVoidRequestImpl::requestSucceeded): Deleted.
1839         (WebCore::RTCVoidRequestImpl::requestFailed): Deleted.
1840         (WebCore::RTCVoidRequestImpl::stop): Deleted.
1841         (WebCore::RTCVoidRequestImpl::activeDOMObjectName): Deleted.
1842         (WebCore::RTCVoidRequestImpl::canSuspendForPageCache): Deleted.
1843         (WebCore::RTCVoidRequestImpl::clear): Deleted.
1844         * WebCore.xcodeproj/project.pbxproj:
1845         * bindings/js/JSDictionary.cpp:
1846         (WebCore::JSDictionary::convertValue):
1847         * bindings/js/JSDictionary.h:
1848         * bindings/js/WebCoreBuiltinNames.h:
1849         * bindings/js/WebCoreJSBuiltinInternals.h:
1850         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
1851         (WebCore::JSBuiltinInternalFunctions::rTCPeerConnectionInternals):
1852         (WebCore::JSBuiltinInternalFunctions::visit):
1853         (WebCore::JSBuiltinInternalFunctions::init):
1854         * bindings/js/WebCoreJSBuiltins.cpp:
1855         * bindings/js/WebCoreJSBuiltins.h:
1856         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
1857         (WebCore::JSBuiltinFunctions::rTCPeerConnectionBuiltins):
1858         (WebCore::JSBuiltinFunctions::rTCPeerConnectionInternalsBuiltins):
1859         * dom/EventNames.in:
1860
1861 2015-11-15  David Kilzer  <ddkilzer@apple.com>
1862
1863         REGRESSION (r192404): Fix tvOS and watchOS builds
1864
1865         * platform/spi/cocoa/QuartzCoreSPI.h: Add more version checks to
1866         fix all the builds.
1867
1868 2015-11-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1869
1870         [EFL][GTK] Remove use of String::format() in versionForUAString()
1871         https://bugs.webkit.org/show_bug.cgi?id=151250
1872
1873         Reviewed by Darin Adler.
1874
1875         As String::format() will be deprecated due to the security problem, reimplement
1876         versionForUAString() using a macro.
1877
1878         * platform/efl/UserAgentEfl.cpp:
1879         (WebCore::versionForUAString):
1880         * platform/gtk/UserAgentGtk.cpp:
1881         (WebCore::platformVersionForUAString):
1882         (WebCore::versionForUAString):
1883
1884 2015-11-14  Antti Koivisto  <antti@apple.com>
1885
1886         Regression(r188820): Downloads of data URLs is broken
1887         https://bugs.webkit.org/show_bug.cgi?id=150900
1888         rdar://problem/23399223
1889
1890         Reviewed by Darin Adler.
1891
1892         No test, the current test infrastructure only allows testing policy decisions, not the actual download.
1893
1894         * loader/DocumentLoader.cpp:
1895         (WebCore::DocumentLoader::continueAfterContentPolicy):
1896
1897         Use normal download path for data URLs instead of trying to convert the main resource load.
1898         Since we decode data URLs locally there is no associated resource load on WebKit side.
1899
1900 2015-11-14  Nan Wang  <n_wang@apple.com>
1901
1902         AX: add a new trait for elements in fieldset on iOS
1903         https://bugs.webkit.org/show_bug.cgi?id=151281
1904
1905         Reviewed by Chris Fleizach.
1906
1907         Added a new trait for elements in the fieldset, so VoiceOver can speak the legend
1908         information for those elements.
1909
1910         Test: accessibility/ios-simulator/fieldset-traits.html
1911
1912         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1913         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
1914         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
1915         (-[WebAccessibilityObjectWrapper _accessibilityFieldsetAncestor]):
1916         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1917
1918 2015-11-13  Commit Queue  <commit-queue@webkit.org>
1919
1920         Unreviewed, rolling out r192445, r192451, and r192452.
1921         https://bugs.webkit.org/show_bug.cgi?id=151291
1922
1923         Broke Mavericks build (and thus EWS) (Requested by ap on
1924         #webkit).
1925
1926         Reverted changesets:
1927
1928         "Add identifier strings for a bunch of context menu items"
1929         https://bugs.webkit.org/show_bug.cgi?id=151272
1930         http://trac.webkit.org/changeset/192445
1931
1932         "Try to fix the 32-bit build"
1933         http://trac.webkit.org/changeset/192451
1934
1935         "Try to fix the 32-bit build"
1936         http://trac.webkit.org/changeset/192452
1937
1938 2015-11-13  Anders Carlsson  <andersca@apple.com>
1939
1940         Add identifier strings for a bunch of context menu items
1941         https://bugs.webkit.org/show_bug.cgi?id=151272
1942
1943         Reviewed by Dan Bernstein.
1944
1945         Have NSMenuItem conform to NSUserInterfaceItemIdentification.
1946
1947         * platform/spi/mac/NSMenuSPI.h:
1948
1949 2015-11-13  Zalan Bujtas  <zalan@apple.com>
1950
1951         Always render at least a device pixel line when border/outline width > 0.
1952         https://bugs.webkit.org/show_bug.cgi?id=151269
1953
1954         This matches Firefox behaviour.
1955
1956         Reviewed by Simon Fraser.
1957
1958         Existing test is modified to reflect the new behaviour.
1959
1960         * css/StyleBuilderConverter.h:
1961         (WebCore::StyleBuilderConverter::convertLineWidth):
1962         * rendering/BorderEdge.cpp:
1963         (WebCore::BorderEdge::BorderEdge): Deleted.
1964         * rendering/BorderEdge.h:
1965
1966 2015-11-13  Per Arne Vollan  <peavo@outlook.com>
1967
1968         [WinCairo][MediaFoundation] Video rendered at wrong position.
1969         https://bugs.webkit.org/show_bug.cgi?id=151271
1970
1971         Reviewed by Alex Christensen.
1972
1973         The source rectangle used when blitting a frame to the graphics context
1974         should have offset (0, 0).
1975
1976         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1977         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
1978
1979 2015-11-13  Joseph Pecoraro  <pecoraro@apple.com>
1980
1981         Web Inspector: Provide a way to override the WKWebView remote inspector name
1982         https://bugs.webkit.org/show_bug.cgi?id=151075
1983
1984         Reviewed by Tim Horton.
1985
1986         * page/Page.cpp:
1987         (WebCore::Page::remoteInspectionNameOverride):
1988         (WebCore::Page::setRemoteInspectionNameOverride):
1989         * page/Page.h:
1990         * page/PageDebuggable.cpp:
1991         (WebCore::PageDebuggable::name):
1992         (WebCore::PageDebuggable::setNameOverride):
1993         * page/PageDebuggable.h:
1994
1995 2015-11-13  Jiewen Tan  <jiewen_tan@apple.com>
1996
1997         Element::focus() should acquire the ownership of Frame.
1998         https://bugs.webkit.org/show_bug.cgi?id=150204
1999         <rdar://problem/23136794>
2000
2001         Reviewed by Brent Fulgham.
2002
2003         The FrameSelection::setSelection method sometimes releases the last reference to a frame.
2004         When this happens, the Element::updateFocusAppearance would attempt to use dereferenced memory.
2005         Instead, we should ensure that the Frame lifetime is guaranteed to extend through the duration
2006         of the method call.
2007
2008         Test: editing/selection/focus-iframe-removal-crash.html
2009
2010         * dom/Element.cpp:
2011         (WebCore::Element::updateFocusAppearance):
2012
2013 2015-11-13  Sergio Villar Senin  <svillar@igalia.com>
2014
2015         [css-grid] Remove unused GridResolvedPosition constructor
2016         https://bugs.webkit.org/show_bug.cgi?id=151133
2017
2018         Reviewed by Mario Sanchez Prada.
2019
2020         No new tests required, just deleting dead code.
2021
2022         * rendering/style/GridResolvedPosition.cpp:
2023         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2024         * rendering/style/GridResolvedPosition.h:
2025
2026 2015-11-13  Sergio Villar Senin  <svillar@igalia.com>
2027
2028         ASSERTION FAILED: m_isEngaged in WTF::Optional::value
2029         https://bugs.webkit.org/show_bug.cgi?id=151094
2030
2031         Reviewed by Darin Adler.
2032
2033         That ASSERT was hit because the precondition was incorrectly
2034         met, i.e., we're considering that the main axis length was
2035         definite when it was actually not. The problem is that to
2036         determine whether it was indefinite or not we're using
2037         RenderBox::hasDefiniteLogicalHeight() which did not perfectly
2038         match RenderBox::computePercentageLogicalHeight() for the case
2039         of RenderTables. So computePercentageLogicalHeight() was
2040         returning Nullopt (i.e. indefinite) while
2041         hasDefiniteLogicalHeight() was returning true (so definite).
2042
2043         Some checks were refactored in a helper function to solve the
2044         inconsistency so that both functions behave the same way even
2045         in this particular situation.
2046
2047         Test: css3/flexbox/inline-flex-percentage-height-in-table-crash.html
2048
2049         * rendering/RenderBox.cpp:
2050         (WebCore::tableCellShouldHaveZeroInitialSize):
2051         (WebCore::RenderBox::computePercentageLogicalHeight):
2052         (WebCore::percentageLogicalHeightIsResolvable):
2053         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
2054         * rendering/RenderBox.h:
2055
2056 2015-11-13  Csaba Osztrogonác  <ossy@webkit.org>
2057
2058         Unreviewed, really fix the Mac CMake build after r192376.
2059
2060         * PlatformMac.cmake:
2061
2062 2015-11-13  Csaba Osztrogonác  <ossy@webkit.org>
2063
2064         Unreviewed, fix the Mac CMake build after r192376.
2065
2066         * PlatformMac.cmake:
2067
2068 2015-11-12  Tim Horton  <timothy_horton@apple.com>
2069
2070         Follow up to the previous change
2071
2072         * platform/spi/cocoa/QuartzCoreSPI.h:
2073         Somehow this escaped.
2074
2075 2015-11-12  Tim Horton  <timothy_horton@apple.com>
2076
2077         Try to fix the Watch/TV build
2078
2079         * platform/spi/cocoa/QuartzCoreSPI.h:
2080         Be more accurate about where we need these.
2081
2082 2015-11-12  Brady Eidson  <beidson@apple.com>
2083
2084         Modern IDB: Pipe through cursor functions from client to server.
2085         https://bugs.webkit.org/show_bug.cgi?id=151197
2086
2087         Reviewed by Alex Christensen.
2088
2089         Tests: storage/indexeddb/modern/cursor-1.html
2090                storage/indexeddb/modern/opencursor-failures.html
2091
2092         This patch implements most IDBCursor considerations at the IDL level, as well as pipes the
2093         appropriate messages through from client to server.
2094         
2095         All operations currently end in errors. Bug 151196 will fix that by making cursors functional.
2096         
2097         * CMakeLists.txt:
2098         * WebCore.xcodeproj/project.pbxproj:
2099
2100         * Modules/indexeddb/IDBCursor.h:
2101         (WebCore::IDBCursor::isKeyCursor): Deleted.
2102         * Modules/indexeddb/IDBCursorWithValue.h:
2103
2104         * Modules/indexeddb/IDBGetResult.h:
2105
2106         * Modules/indexeddb/IDBKeyData.h:
2107         (WebCore::IDBKeyData::string):
2108         (WebCore::IDBKeyData::date):
2109         (WebCore::IDBKeyData::number):
2110         (WebCore::IDBKeyData::array):
2111
2112         * Modules/indexeddb/IndexedDB.h:
2113
2114         * Modules/indexeddb/client/IDBAnyImpl.cpp:
2115         (WebCore::IDBClient::IDBAny::IDBAny):
2116         (WebCore::IDBClient::IDBAny::idbCursor):
2117         (WebCore::IDBClient::IDBAny::idbCursorWithValue):
2118         (WebCore::IDBClient::IDBAny::idbIndex):
2119         (WebCore::IDBClient::IDBAny::idbObjectStore):
2120         (WebCore::IDBClient::IDBAny::modernIDBCursor):
2121         * Modules/indexeddb/client/IDBAnyImpl.h:
2122         (WebCore::IDBClient::IDBAny::create):
2123
2124         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2125         (WebCore::IDBClient::IDBConnectionToServer::openCursor):
2126         (WebCore::IDBClient::IDBConnectionToServer::didOpenCursor):
2127         (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
2128         (WebCore::IDBClient::IDBConnectionToServer::didIterateCursor):
2129         * Modules/indexeddb/client/IDBConnectionToServer.h:
2130         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2131
2132         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2133         (WebCore::IDBClient::IDBCursor::create):
2134         (WebCore::IDBClient::IDBCursor::IDBCursor):
2135         (WebCore::IDBClient::IDBCursor::sourcesDeleted):
2136         (WebCore::IDBClient::IDBCursor::effectiveObjectStore):
2137         (WebCore::IDBClient::IDBCursor::transaction):
2138         (WebCore::IDBClient::IDBCursor::direction):
2139         (WebCore::IDBClient::IDBCursor::key):
2140         (WebCore::IDBClient::IDBCursor::primaryKey):
2141         (WebCore::IDBClient::IDBCursor::value):
2142         (WebCore::IDBClient::IDBCursor::source):
2143         (WebCore::IDBClient::IDBCursor::update):
2144         (WebCore::IDBClient::IDBCursor::advance):
2145         (WebCore::IDBClient::IDBCursor::continueFunction):
2146         (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor):
2147         (WebCore::IDBClient::IDBCursor::deleteFunction):
2148         (WebCore::IDBClient::IDBCursor::setGetResult):
2149         * Modules/indexeddb/client/IDBCursorImpl.h:
2150         (WebCore::IDBClient::IDBCursor::info):
2151         (WebCore::IDBClient::IDBCursor::setRequest):
2152         (WebCore::IDBClient::IDBCursor::clearRequest):
2153         (WebCore::IDBClient::IDBCursor::request):
2154
2155         * Modules/indexeddb/client/IDBCursorWithValueImpl.cpp:
2156         (WebCore::IDBClient::IDBCursorWithValue::create):
2157         (WebCore::IDBClient::IDBCursorWithValue::IDBCursorWithValue):
2158         (WebCore::IDBClient::IDBCursorWithValue::~IDBCursorWithValue):
2159         * Modules/indexeddb/client/IDBCursorWithValueImpl.h:
2160
2161         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2162         (WebCore::IDBClient::IDBIndex::openCursor):
2163         (WebCore::IDBClient::IDBIndex::openKeyCursor):
2164         * Modules/indexeddb/client/IDBIndexImpl.h:
2165         (WebCore::IDBClient::IDBIndex::modernObjectStore):
2166         (WebCore::IDBClient::IDBIndex::isDeleted):
2167
2168         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2169         (WebCore::IDBClient::IDBObjectStore::openCursor):
2170         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2171         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2172
2173         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2174         (WebCore::IDBClient::IDBRequest::create):
2175         (WebCore::IDBClient::IDBRequest::IDBRequest):
2176         (WebCore::IDBClient::IDBRequest::~IDBRequest):
2177         (WebCore::IDBClient::IDBRequest::source):
2178         (WebCore::IDBClient::IDBRequest::resultCursor):
2179         (WebCore::IDBClient::IDBRequest::willIterateCursor):
2180         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor):
2181         (WebCore::IDBClient::IDBRequest::requestCompleted):
2182         * Modules/indexeddb/client/IDBRequestImpl.h:
2183         (WebCore::IDBClient::IDBRequest::modernResult):
2184
2185         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2186         (WebCore::IDBClient::IDBTransaction::requestOpenCursor):
2187         (WebCore::IDBClient::IDBTransaction::doRequestOpenCursor):
2188         (WebCore::IDBClient::IDBTransaction::openCursorOnServer):
2189         (WebCore::IDBClient::IDBTransaction::didOpenCursorOnServer):
2190         (WebCore::IDBClient::IDBTransaction::iterateCursor):
2191         (WebCore::IDBClient::IDBTransaction::iterateCursorOnServer):
2192         (WebCore::IDBClient::IDBTransaction::didIterateCursorOnServer):
2193         * Modules/indexeddb/client/IDBTransactionImpl.h:
2194
2195         * Modules/indexeddb/client/TransactionOperation.h:
2196         (WebCore::IDBClient::createTransactionOperation):
2197
2198         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2199         (WebCore::LegacyCursor::source):
2200         * Modules/indexeddb/legacy/LegacyCursor.h:
2201         (WebCore::LegacyCursor::continueFunction): Deleted.
2202         (WebCore::LegacyCursor::isKeyCursor): Deleted.
2203         * Modules/indexeddb/legacy/LegacyCursorWithValue.h:
2204
2205         * Modules/indexeddb/server/IDBBackingStore.h:
2206
2207         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2208         (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
2209         (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
2210         * Modules/indexeddb/server/IDBConnectionToClient.h:
2211         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2212
2213         * Modules/indexeddb/server/IDBServer.cpp:
2214         (WebCore::IDBServer::IDBServer::openCursor):
2215         (WebCore::IDBServer::IDBServer::iterateCursor):
2216         * Modules/indexeddb/server/IDBServer.h:
2217
2218         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2219         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
2220         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
2221         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2222
2223         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2224         (WebCore::IDBServer::UniqueIDBDatabase::openCursor):
2225         (WebCore::IDBServer::UniqueIDBDatabase::performOpenCursor):
2226         (WebCore::IDBServer::UniqueIDBDatabase::didPerformOpenCursor):
2227         (WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
2228         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
2229         (WebCore::IDBServer::UniqueIDBDatabase::didPerformIterateCursor):
2230         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2231
2232         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
2233         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
2234         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
2235         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
2236         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2237
2238         * Modules/indexeddb/shared/IDBCursorInfo.cpp: Added.
2239         (WebCore::IDBCursorInfo::objectStoreCursor):
2240         (WebCore::IDBCursorInfo::indexCursor):
2241         (WebCore::IDBCursorInfo::IDBCursorInfo):
2242         (WebCore::IDBCursorInfo::isDirectionForward):
2243         (WebCore::IDBCursorInfo::isolatedCopy):
2244         * Modules/indexeddb/shared/IDBCursorInfo.h: Added.
2245         (WebCore::IDBCursorInfo::identifier):
2246         (WebCore::IDBCursorInfo::sourceIdentifier):
2247         (WebCore::IDBCursorInfo::cursorSource):
2248         (WebCore::IDBCursorInfo::cursorDirection):
2249         (WebCore::IDBCursorInfo::cursorType):
2250
2251         * Modules/indexeddb/shared/IDBResultData.cpp:
2252         (WebCore::IDBResultData::openCursorSuccess):
2253         (WebCore::IDBResultData::iterateCursorSuccess):
2254         * Modules/indexeddb/shared/IDBResultData.h:
2255
2256         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2257         (WebCore::InProcessIDBServer::didOpenCursor):
2258         (WebCore::InProcessIDBServer::didIterateCursor):
2259         (WebCore::InProcessIDBServer::openCursor):
2260         (WebCore::InProcessIDBServer::iterateCursor):
2261         * Modules/indexeddb/shared/InProcessIDBServer.h:
2262
2263         * bindings/js/IDBBindingUtilities.cpp:
2264         (WebCore::idbKeyDataToJSValue):
2265         * bindings/js/IDBBindingUtilities.h:
2266
2267         * platform/CrossThreadCopier.cpp:
2268         (WebCore::IDBCursorInfo>::copy):
2269         * platform/CrossThreadCopier.h:
2270
2271 2015-11-12  Anders Carlsson  <andersca@apple.com>
2272
2273         Delete PlatformMenuDescription.h
2274         https://bugs.webkit.org/show_bug.cgi?id=151229
2275
2276         Reviewed by Beth Dakin.
2277
2278         * WebCore.vcxproj/WebCore.vcxproj:
2279         * WebCore.vcxproj/WebCore.vcxproj.filters:
2280         * WebCore.xcodeproj/project.pbxproj:
2281         * page/ContextMenuClient.h:
2282         * platform/ContextMenu.h:
2283         * platform/ContextMenuItem.h:
2284         * platform/PlatformMenuDescription.h: Removed.
2285
2286 2015-11-12  Anders Carlsson  <andersca@apple.com>
2287
2288         ContextMenuAction and WebMenuItemTag shouldn't have to be in sync
2289         https://bugs.webkit.org/show_bug.cgi?id=151226
2290
2291         Reviewed by Tim Horton.
2292
2293         * page/ContextMenuController.cpp:
2294         * platform/ContextMenuItem.h:
2295         Remove now unneeded comments. Also, remove ContextMenuItemTagOpenLinkInThisWindow since it wasn't used by any of our remaining ports.
2296
2297 2015-11-12  Zalan Bujtas  <zalan@apple.com>
2298
2299         Ignore visited background color when deciding if the input renderer needs to be painted natively.
2300         https://bugs.webkit.org/show_bug.cgi?id=151211
2301         rdar://problem/21449823
2302
2303         Reviewed by Antti Koivisto.
2304
2305         Test: fast/css/pseudo-visited-background-color-on-input.html
2306
2307         * rendering/RenderTheme.cpp:
2308         (WebCore::RenderTheme::isControlStyled):
2309         * rendering/style/RenderStyle.h:
2310
2311 2015-11-12  David Hyatt  <hyatt@apple.com>
2312
2313         Tatechuyoko shrink-to-fit breaks after changing color, background-color or text-decoration
2314         https://bugs.webkit.org/show_bug.cgi?id=151218
2315         <rdar://problem/23521702>
2316
2317         Reviewed by Myles Maxfield.
2318
2319         Added fast/text/text-combine-shrink-on-color-change.html
2320
2321         * rendering/RenderCombineText.cpp:
2322         (WebCore::RenderCombineText::styleDidChange):
2323
2324 2015-11-12  Anders Carlsson  <andersca@apple.com>
2325
2326         Use ContextMenuItemTagNoAction instead of ContextMenuItemCustomTagNoAction
2327         https://bugs.webkit.org/show_bug.cgi?id=151222
2328
2329         Reviewed by Joseph Pecoraro.
2330
2331         * bindings/js/JSInspectorFrontendHostCustom.cpp:
2332         (WebCore::populateContextMenuItems):
2333         * page/ContextMenuController.cpp:
2334         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Deleted.
2335         * platform/ContextMenuItem.h:
2336
2337 2015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
2338
2339         [Cocoa] Font fallback is not language-sensitive
2340         https://bugs.webkit.org/show_bug.cgi?id=147390
2341
2342         Reviewed by Dean Jackson.
2343
2344         Test: fast/text/fallback-language-han-2.html
2345
2346         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2347         (WebCore::FontCache::systemFallbackForCharacters):
2348
2349 2015-11-12  Anders Carlsson  <andersca@apple.com>
2350
2351         ContextMenuController::contextMenuItemSelected only needs the action and title, not the full item
2352         https://bugs.webkit.org/show_bug.cgi?id=151217
2353
2354         Reviewed by Joseph Pecoraro.
2355
2356         * inspector/InspectorFrontendHost.cpp:
2357         * page/ContextMenuController.cpp:
2358         (WebCore::ContextMenuController::contextMenuItemSelected):
2359         * page/ContextMenuController.h:
2360         * page/ContextMenuProvider.h:
2361
2362 2015-11-12  Anders Carlsson  <andersca@apple.com>
2363
2364         Remove an unused function
2365         https://bugs.webkit.org/show_bug.cgi?id=151215
2366
2367         Reviewed by Joseph Pecoraro.
2368
2369         * loader/EmptyClients.h:
2370         * page/ContextMenuClient.h:
2371         * page/ContextMenuController.cpp:
2372         (WebCore::ContextMenuController::contextMenuItemSelected): Deleted.
2373
2374 2015-11-11  Anders Carlsson  <andersca@apple.com>
2375
2376         Enable cross-platform context menus by default
2377         https://bugs.webkit.org/show_bug.cgi?id=151173
2378
2379         Reviewed by Tim Horton.
2380
2381         * WebCore.xcodeproj/project.pbxproj:
2382         * bindings/js/JSInspectorFrontendHostCustom.cpp:
2383         (WebCore::JSInspectorFrontendHost::showContextMenu):
2384         * page/ContextMenuController.cpp:
2385         (WebCore::ContextMenuController::addInspectElementItem): Deleted.
2386         * platform/ContextMenu.cpp:
2387         * platform/ContextMenu.h:
2388         * platform/ContextMenuItem.cpp:
2389         * platform/ContextMenuItem.h:
2390         (WebCore::ContextMenuItem::isNull): Deleted.
2391         * platform/mac/ContextMenuItemMac.mm: Removed.
2392         (WebCore::menuToArray): Deleted.
2393         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
2394         (WebCore::createPlatformMenuItemDescription): Deleted.
2395         (WebCore::ContextMenuItem::~ContextMenuItem): Deleted.
2396         (WebCore::ContextMenuItem::platformDescription): Deleted.
2397         (WebCore::ContextMenuItem::type): Deleted.
2398         (WebCore::ContextMenuItem::action): Deleted.
2399         (WebCore::ContextMenuItem::title): Deleted.
2400         (WebCore::ContextMenuItem::platformSubMenu): Deleted.
2401         (WebCore::ContextMenuItem::setType): Deleted.
2402         (WebCore::ContextMenuItem::setAction): Deleted.
2403         (WebCore::ContextMenuItem::setTitle): Deleted.
2404         (WebCore::ContextMenuItem::setSubMenu): Deleted.
2405         (WebCore::ContextMenuItem::setChecked): Deleted.
2406         (WebCore::ContextMenuItem::setEnabled): Deleted.
2407         (WebCore::ContextMenuItem::enabled): Deleted.
2408         (WebCore::ContextMenuItem::checked): Deleted.
2409         * platform/mac/ContextMenuMac.mm: Removed.
2410         (WebCore::ContextMenu::ContextMenu): Deleted.
2411         (WebCore::ContextMenu::~ContextMenu): Deleted.
2412         (WebCore::ContextMenu::appendItem): Deleted.
2413         (WebCore::ContextMenu::insertItem): Deleted.
2414         (WebCore::ContextMenu::itemCount): Deleted.
2415         (WebCore::ContextMenu::setPlatformDescription): Deleted.
2416         (WebCore::ContextMenu::platformDescription): Deleted.
2417         (WebCore::ContextMenu::releasePlatformDescription): Deleted.
2418         (WebCore::contextMenuItemVector): Deleted.
2419         (WebCore::platformMenuDescription): Deleted.
2420
2421 2015-11-12  Myles C. Maxfield  <mmaxfield@apple.com>
2422
2423         [Cocoa] Font fallback is not language-sensitive
2424         https://bugs.webkit.org/show_bug.cgi?id=147390
2425
2426         Reviewed by Dean Jackson.
2427
2428         This re-applies r190754 in a somewhat more performant way.
2429
2430         Test: fast/text/fallback-language-han-2.html
2431
2432         * platform/graphics/Font.cpp:
2433         (WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
2434         (WebCore::CharacterFallbackMapKey::operator==):
2435         (WebCore::CharacterFallbackMapKeyHash::hash):
2436         (WebCore::Font::systemFallbackFontForCharacter):
2437         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2438         (WebCore::FontCache::systemFallbackForCharacters):
2439
2440 2015-11-11  Jon Honeycutt  <jhoneycutt@apple.com>
2441
2442         popstate event should be dispatched asynchronously
2443         https://bugs.webkit.org/show_bug.cgi?id=36202
2444         <rdar://problem/7761279>
2445
2446         Based on an original patch by Mihai Parparita <mihaip@chromium.org>.
2447
2448         Reviewed by Brent Fulgham.
2449
2450         Tests: fast/loader/remove-iframe-during-history-navigation-different.html
2451                fast/loader/remove-iframe-during-history-navigation-same.html
2452                fast/loader/stateobjects/popstate-is-asynchronous.html
2453
2454         * dom/Document.cpp:
2455         (WebCore::Document::enqueuePopstateEvent):
2456         Use enqueueWindowEvent().
2457
2458 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
2459
2460         Fix build failure due to missing NeverDestroyed.h include after r192169
2461         https://bugs.webkit.org/show_bug.cgi?id=151186
2462
2463         Reviewed by Darin Adler.
2464
2465         * rendering/RenderCombineText.cpp:
2466
2467 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
2468
2469         Fix build failure due to missing forward declaration of FontVariantSettings after r191968
2470         https://bugs.webkit.org/show_bug.cgi?id=151185
2471
2472         Reviewed by Myles C. Maxfield.
2473
2474         * css/CSSFontFaceSource.h:
2475
2476 2015-11-12  Eric Carlson  <eric.carlson@apple.com>
2477
2478         [MediaStream] Reflect media stream tracks as HTMLMediaElement tracks
2479         https://bugs.webkit.org/show_bug.cgi?id=151145
2480
2481         Reviewed by Jer Noble.
2482
2483         Test: fast/mediastream/MediaStream-video-element.html
2484
2485         * WebCore.xcodeproj/project.pbxproj: Add new header files.
2486
2487         * html/track/AudioTrack.h: Add comments to clean things up slightly.
2488         * html/track/VideoTrack.h: Ditto.
2489
2490         Create a AudioTrackPrivateMediaStream or VideoTrackPrivateMediaStream for each track in
2491         the MediaStream.
2492         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2493         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2494         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Call updateTracks.
2495         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didAddTrack): Ditto.
2496         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didRemoveTrack): Ditto.
2497         (WebCore::updateTracksOfType): New, template function to update audio or video tracks.
2498         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): New.
2499
2500         * platform/mediastream/AudioTrackPrivateMediaStream.h: Added.
2501
2502         * platform/mediastream/MediaStreamPrivate.cpp:
2503         (WebCore::MediaStreamPrivate::currentFrameImage): Fix a typo, early return if the track is
2504           not active OR there is no active video track.
2505         * platform/mediastream/MediaStreamPrivate.h:
2506         (WebCore::MediaStreamPrivate::activeVideoTrack): Accessor for active video track, if any.
2507
2508         * platform/mediastream/VideoTrackPrivateMediaStream.h: Added.
2509
2510         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2511         (WebCore::AVAudioCaptureSource::updateStates): Set current states.
2512
2513         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2514         (WebCore::AVMediaCaptureSource::states): Set source ID.
2515         (WebCore::AVMediaCaptureSource::capabilities): Set source ID directly.
2516
2517         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2518         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
2519         (WebCore::AVVideoCaptureSource::updateStates): Set states here instead of in the constructor.
2520
2521         * platform/mock/MockRealtimeMediaSource.cpp:
2522         (WebCore::MockRealtimeMediaSource::capabilities): Set source ID directly.
2523
2524         * platform/mock/MockRealtimeVideoSource.cpp:
2525         (WebCore::MockRealtimeVideoSource::updateStates): Set source type.
2526
2527 2015-11-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2528
2529         XHR abort() event firing does not match spec
2530         https://bugs.webkit.org/show_bug.cgi?id=98404
2531
2532         Reviewed by Darin Adler.
2533
2534         Introducing explicit sendFlag as in the specification.
2535         Previously, sendFlag was computed using !!m_loader.
2536         But this does not work well for loadstart events since sendFlag should be true but m_loader is still null at that time.
2537
2538         Updated abort event firing test according specification.
2539         For instance, compared to previously, the abort event is not fired in DONE state or if sendFlag is not set.
2540
2541         Covered by rebased tests.
2542
2543         * xml/XMLHttpRequest.cpp:
2544         (WebCore::XMLHttpRequest::callReadyStateChangeListener): Compute whether dispatching the load event before calling XHR readystatechange event callback.
2545         (WebCore::XMLHttpRequest::setWithCredentials): Replacing m_loader by m_sendFlag to align with the spec.
2546         (WebCore::XMLHttpRequest::open): Unsetting m_sendFlag..
2547         (WebCore::XMLHttpRequest::initSend): Replacing m_loader by m_sendFlag to align with the spec.
2548         (WebCore::XMLHttpRequest::createRequest): Setting m_sendFlag.
2549         (WebCore::XMLHttpRequest::abort): Checking m_sendFlag and updating code to follow the specification.
2550         (WebCore::XMLHttpRequest::genericError): Unsetting m_sendFlag.
2551         (WebCore::XMLHttpRequest::setRequestHeader): Replacing m_loader by m_sendFlag to align with the spec.
2552         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
2553         (WebCore::XMLHttpRequest::didReachTimeout): Ditto.
2554         * xml/XMLHttpRequest.h: Added m_sendFlag.
2555
2556 2015-11-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2557
2558         [GStreamer] Use RunLoop::timer in MediaPlayerPrivateGStreamerBase for GL drawing
2559         https://bugs.webkit.org/show_bug.cgi?id=151099
2560
2561         Reviewed by Philippe Normand.
2562
2563         Instead of the GThreadSafeMainLoopSource.
2564
2565         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2566         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2567         (WebCore::MediaPlayerPrivateGStreamerBase::repaint):
2568         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2569         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Deleted.
2570         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2571
2572 2015-11-12  Csaba Osztrogonác  <ossy@webkit.org>
2573
2574         Remove ENABLE(SATURATED_LAYOUT_ARITHMETIC) guards
2575         https://bugs.webkit.org/show_bug.cgi?id=150972
2576
2577         Reviewed by Darin Adler.
2578
2579         * Configurations/FeatureDefines.xcconfig:
2580         * platform/LayoutUnit.h:
2581         (WebCore::operator*):
2582         (WebCore::LayoutUnit::LayoutUnit): Deleted.
2583         (WebCore::LayoutUnit::fromFloatCeil): Deleted.
2584         (WebCore::LayoutUnit::fromFloatFloor): Deleted.
2585         (WebCore::LayoutUnit::fromFloatRound): Deleted.
2586         (WebCore::LayoutUnit::ceil): Deleted.
2587         (WebCore::LayoutUnit::round): Deleted.
2588         (WebCore::LayoutUnit::floor): Deleted.
2589         (WebCore::LayoutUnit::setValue): Deleted.
2590         (WebCore::operator/): Deleted.
2591         (WebCore::operator+): Deleted.
2592         (WebCore::operator-): Deleted.
2593         (WebCore::operator+=): Deleted.
2594         (WebCore::operator-=): Deleted.
2595         * rendering/LayoutState.cpp:
2596         (WebCore::LayoutState::LayoutState):
2597         * rendering/LayoutState.h:
2598         (WebCore::LayoutState::LayoutState):
2599         * rendering/RenderView.h:
2600
2601 2015-11-11  Chris Dumez  <cdumez@apple.com>
2602
2603         Stop passing a PassRefPtr to dispatchEvent()
2604         https://bugs.webkit.org/show_bug.cgi?id=151158
2605
2606         Reviewed by Alex Christensen.
2607
2608         Stop passing a PassRefPtr to dispatchEvent() because:
2609         1. PassRefPtr is legacy and should no longer be used
2610         2. We don't actually transfer ownership of the Event to the callee
2611
2612         Pass a C++ reference instead.
2613
2614 2015-11-11  Chris Dumez  <cdumez@apple.com>
2615
2616         Fix leaks in idbKeyFromInspectorObject()
2617         https://bugs.webkit.org/show_bug.cgi?id=151179
2618
2619         Reviewed by Brian Burg.
2620
2621         Fix leaks in idbKeyFromInspectorObject() that were caused by the
2622         NeverDestroyed<> not being marked as static.
2623
2624         * inspector/InspectorIndexedDBAgent.cpp:
2625
2626 2015-11-11  Geoffrey Garen  <ggaren@apple.com>
2627
2628         Rename handle.*Event to dispatch.*Event
2629         https://bugs.webkit.org/show_bug.cgi?id=151168
2630
2631         Reviewed by Chris Dumez.
2632
2633         * dom/Document.cpp:
2634         (WebCore::Document::implicitClose):
2635         * dom/Document.h:
2636         * loader/DocumentLoader.cpp:
2637         (WebCore::DocumentLoader::DocumentLoader):
2638         (WebCore::DocumentLoader::getIconDataForIconURL):
2639         (WebCore::DocumentLoader::dispatchOnloadEvents):
2640         (WebCore::DocumentLoader::handledOnloadEvents): Deleted.
2641         * loader/DocumentLoader.h:
2642         (WebCore::DocumentLoader::isClientRedirect):
2643         (WebCore::DocumentLoader::setIsClientRedirect):
2644         (WebCore::DocumentLoader::wasOnloadDispatched):
2645         (WebCore::DocumentLoader::overrideEncoding):
2646         (WebCore::DocumentLoader::wasOnloadHandled): Deleted.
2647         * loader/EmptyClients.h:
2648         * loader/FrameLoader.cpp:
2649         (WebCore::FrameLoader::submitForm):
2650         (WebCore::FrameLoader::stopLoading):
2651         (WebCore::FrameLoader::userAgent):
2652         (WebCore::FrameLoader::dispatchOnloadEvents):
2653         (WebCore::FrameLoader::frameDetached):
2654         (WebCore::FrameLoader::shouldClose):
2655         (WebCore::FrameLoader::dispatchUnloadEvents):
2656         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2657         (WebCore::FrameLoader::handledOnloadEvents): Deleted.
2658         (WebCore::FrameLoader::handleUnloadEvents): Deleted.
2659         (WebCore::FrameLoader::handleBeforeUnloadEvent): Deleted.
2660         * loader/FrameLoader.h:
2661         * loader/FrameLoaderClient.h:
2662         * loader/NavigationScheduler.cpp:
2663         (WebCore::NavigationScheduler::mustLockBackForwardList):
2664
2665 2015-11-11  Anders Carlsson  <andersca@apple.com>
2666
2667         Remove more dead code
2668         https://bugs.webkit.org/show_bug.cgi?id=151170
2669
2670         Reviewed by Beth Dakin.
2671
2672         * platform/ContextMenu.cpp:
2673         (WebCore::findItemWithAction): Deleted.
2674         (WebCore::ContextMenu::itemWithAction): Deleted.
2675         * platform/ContextMenu.h:
2676         (WebCore::ContextMenu::itemAtIndex): Deleted.
2677         * platform/ContextMenuItem.h:
2678
2679 2015-11-11  Anders Carlsson  <andersca@apple.com>
2680
2681         De-indent ContextMenu.h and ContextMenuItem.h.
2682
2683         Rubber-stamped by Andreas Kling.
2684
2685         * platform/ContextMenu.h:
2686         * platform/ContextMenuItem.h:
2687
2688 2015-11-11  Anders Carlsson  <andersca@apple.com>
2689
2690         Remove ContextMenuWin.cpp and ContextMenuItemWin.cpp
2691         https://bugs.webkit.org/show_bug.cgi?id=150467
2692
2693         Reviewed by Beth Dakin.
2694
2695         These files are not needed anymore.
2696
2697         * PlatformWin.cmake:
2698         * WebCore.vcxproj/WebCore.vcxproj:
2699         * WebCore.vcxproj/WebCore.vcxproj.filters:
2700         * platform/win/ContextMenuItemWin.cpp: Removed.
2701         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
2702         (WebCore::ContextMenuItem::platformContextMenuItem): Deleted.
2703         * platform/win/ContextMenuWin.cpp: Removed.
2704         (WebCore::ContextMenu::ContextMenu): Deleted.
2705         (WebCore::ContextMenu::getContextMenuItems): Deleted.
2706         (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted.
2707         (WebCore::ContextMenu::platformContextMenu): Deleted.
2708
2709 2015-11-11  Anders Carlsson  <andersca@apple.com>
2710
2711         Get rid of ContextMenuNone.cpp and ContextMenuItemNone.cpp
2712         https://bugs.webkit.org/show_bug.cgi?id=151169
2713
2714         Reviewed by Beth Dakin.
2715
2716         * PlatformEfl.cmake:
2717         * platform/ContextMenuItemNone.cpp: Removed.
2718         (WebCore::ContextMenuItem::platformContextMenuItem): Deleted.
2719         * platform/ContextMenuNone.cpp: Removed.
2720         (WebCore::ContextMenu::ContextMenu): Deleted.
2721         (WebCore::ContextMenu::getContextMenuItems): Deleted.
2722         (WebCore::ContextMenu::createPlatformContextMenuFromItems): Deleted.
2723         (WebCore::ContextMenu::platformContextMenu): Deleted.
2724
2725 2015-11-11  Anders Carlsson  <andersca@apple.com>
2726
2727         Remove more dead context menu code
2728         https://bugs.webkit.org/show_bug.cgi?id=151163
2729
2730         Reviewed by Tim Horton.
2731
2732         * loader/EmptyClients.h:
2733         * page/ContextMenuClient.h:
2734         * page/ContextMenuController.cpp:
2735         (WebCore::ContextMenuController::populate):
2736         * platform/ContextMenuItem.h:
2737         * platform/mac/ContextMenuItemMac.mm:
2738         (WebCore::ContextMenuItem::shareMenuItem): Deleted.
2739
2740 2015-11-10  Jon Honeycutt  <jhoneycutt@apple.com>
2741
2742         Crash loading Blink layout test fast/parser/strip-script-attrs-on-input.html
2743         https://bugs.webkit.org/show_bug.cgi?id=150201
2744         <rdar://problem/23136478>
2745
2746         Reviewed by Brent Fulgham.
2747
2748         Test: fast/parser/strip-script-attrs-on-input.html
2749
2750         * html/parser/HTMLTreeBuilder.cpp:
2751         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
2752         Get the attribute after calling
2753         HTMLConstructionSite::insertSelfClosingHTMLElement(), as this may
2754         mutate the token's attributes.
2755
2756 2015-11-11  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2757
2758         [Streams API] Remove bind usage
2759         https://bugs.webkit.org/show_bug.cgi?id=151104
2760
2761         Reviewed by Youenn Fablet.
2762
2763         Instead of using bind, an inline error function was created.
2764
2765         Internal rework, no tests needed.
2766
2767         * Modules/streams/WritableStream.js:
2768         (error):
2769         (initializeWritableStream):
2770
2771 2015-11-10  Brady Eidson  <beidson@apple.com>
2772
2773         Modern IDB: Make indexes actually index.
2774         https://bugs.webkit.org/show_bug.cgi?id=150939
2775
2776         Reviewed by Alex Christensen.
2777
2778         Tests: storage/indexeddb/modern/index-1.html
2779                storage/indexeddb/modern/index-2.html
2780                storage/indexeddb/modern/index-3.html
2781
2782         * CMakeLists.txt:
2783         * WebCore.xcodeproj/project.pbxproj:
2784
2785         * Modules/indexeddb/IDBKeyData.h:
2786         (WebCore::IDBKeyData::hash): Deleted.
2787
2788         * Modules/indexeddb/IDBKeyRangeData.cpp:
2789         (WebCore::IDBKeyRangeData::isExactlyOneKey):
2790
2791         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2792         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
2793
2794         * Modules/indexeddb/server/IndexValueEntry.cpp: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp.
2795         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
2796         (WebCore::IDBServer::IndexValueEntry::~IndexValueEntry):
2797         (WebCore::IDBServer::IndexValueEntry::addKey):
2798         (WebCore::IDBServer::IndexValueEntry::removeKey):
2799         (WebCore::IDBServer::IndexValueEntry::getLowest):
2800         (WebCore::IDBServer::IndexValueEntry::getCount):
2801         * Modules/indexeddb/server/IndexValueEntry.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h.
2802
2803         * Modules/indexeddb/server/IndexValueStore.cpp: Added.
2804         (WebCore::IDBServer::IndexValueStore::IndexValueStore):
2805         (WebCore::IDBServer::IndexValueStore::lowestValueForKey):
2806         (WebCore::IDBServer::IndexValueStore::countForKey):
2807         (WebCore::IDBServer::IndexValueStore::contains):
2808         (WebCore::IDBServer::IndexValueStore::addRecord):
2809         (WebCore::IDBServer::IndexValueStore::removeRecord):
2810         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey):
2811         (WebCore::IDBServer::IndexValueStore::lowestKeyWithRecordInRange):
2812         * Modules/indexeddb/server/IndexValueStore.h: Copied from Source/WebCore/Modules/indexeddb/server/MemoryIndex.h.
2813
2814         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2815         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
2816         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexCleared):
2817         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2818         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
2819
2820         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2821         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2822
2823         * Modules/indexeddb/server/MemoryIndex.cpp:
2824         (WebCore::IDBServer::MemoryIndex::create):
2825         (WebCore::IDBServer::MemoryIndex::MemoryIndex):
2826         (WebCore::IDBServer::MemoryIndex::objectStoreCleared):
2827         (WebCore::IDBServer::MemoryIndex::replaceIndexValueStore):
2828         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange):
2829         (WebCore::IDBServer::MemoryIndex::countForKeyRange):
2830         (WebCore::IDBServer::MemoryIndex::putIndexKey):
2831         (WebCore::IDBServer::MemoryIndex::removeRecord):
2832         (WebCore::IDBServer::MemoryIndex::removeEntriesWithValueKey):
2833         (WebCore::IDBServer::MemoryIndex::valueForKeyRange): Deleted.
2834         * Modules/indexeddb/server/MemoryIndex.h:
2835
2836         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2837         (WebCore::IDBServer::MemoryObjectStore::createIndex):
2838         (WebCore::IDBServer::MemoryObjectStore::clear):
2839         (WebCore::IDBServer::MemoryObjectStore::deleteRecord):
2840         (WebCore::IDBServer::MemoryObjectStore::addRecord):
2841         (WebCore::IDBServer::indexVM):
2842         (WebCore::IDBServer::indexGlobalExec):
2843         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord):
2844         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2845         (WebCore::IDBServer::MemoryObjectStore::indexValueForKeyRange):
2846         * Modules/indexeddb/server/MemoryObjectStore.h:
2847         (WebCore::IDBServer::MemoryObjectStore::writeTransaction):
2848
2849         * Modules/indexeddb/shared/IndexKey.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp.
2850         (WebCore::IndexKey::IndexKey):
2851         (WebCore::IndexKey::isolatedCopy):
2852         (WebCore::IndexKey::asOneKey):
2853         (WebCore::IndexKey::multiEntry):
2854         * Modules/indexeddb/shared/IndexKey.h: Added.
2855         (WebCore::IndexKey::isNull):
2856
2857         * bindings/js/IDBBindingUtilities.cpp:
2858         (WebCore::idbValueDataToJSValue):
2859         (WebCore::deserializeIDBValueBuffer):
2860         (WebCore::idbKeyDataToScriptValue):
2861         (WebCore::createKeyPathArray):
2862         (WebCore::generateIndexKeyForValue):
2863         * bindings/js/IDBBindingUtilities.h:
2864
2865 2015-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
2866
2867         Move locale information into FontDescription
2868         https://bugs.webkit.org/show_bug.cgi?id=147457
2869
2870         Reviewed by Andreas Kling.
2871
2872         Currently, the "lang" attribute on a node sets locale information in RenderStyle.
2873         Font selection is sensitive to this locale information, and occurs deep within
2874         platform/ code, far away from RenderStyle. Because every RenderStyle owns a
2875         FontDescription, and font selection can consult with FontDescriptions, it makes
2876         sense to move the variable from RenderStyle to FontDescription, and provide
2877         convenience methods on RenderStyle which inspect its FontDescription for locale
2878         information.
2879
2880         This patch is in preparation for correctly obeying locale information when
2881         performing font fallback.
2882
2883         No new tests because there is no behavior change.
2884
2885         * css/CSSPropertyNames.in:
2886         * css/StyleBuilderCustom.h:
2887         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
2888         * platform/graphics/FontCache.h:
2889         * platform/graphics/FontDescription.cpp:
2890         (WebCore::FontDescription::setLocale):
2891         * platform/graphics/FontDescription.h:
2892         (WebCore::FontDescription::locale):
2893         (WebCore::FontDescription::operator==):
2894         (WebCore::FontCascadeDescription::initialLocale):
2895         (WebCore::FontDescription::setScript): Deleted.
2896         * rendering/style/RenderStyle.cpp:
2897         (WebCore::RenderStyle::changeRequiresLayout): Deleted.
2898         * rendering/style/RenderStyle.h:
2899         * rendering/style/StyleRareInheritedData.cpp:
2900         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Deleted.
2901         (WebCore::StyleRareInheritedData::operator==): Deleted.
2902         * rendering/style/StyleRareInheritedData.h:
2903         * style/StyleResolveForDocument.cpp:
2904         (WebCore::Style::resolveForDocument):
2905
2906 2015-11-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2907
2908         [EFL] Support an applicationVersion argument to UserAgentEfl::standardUserAgent() 
2909         https://bugs.webkit.org/show_bug.cgi?id=151060
2910
2911         Reviewed by Darin Adler.
2912
2913         *applicationVersion* was missed to support by r192148. This patch adds it as well as
2914         missed Darin comments are fixed.
2915
2916         * platform/efl/UserAgentEfl.cpp:
2917         (WebCore::platformVersionForUAString):
2918         (WebCore::versionForUAString):
2919         (WebCore::standardUserAgent):
2920
2921 2015-11-10  Simon Fraser  <simon.fraser@apple.com>
2922
2923         Use different pixel formats for displays that support them
2924         https://bugs.webkit.org/show_bug.cgi?id=151122
2925         rdar://problem/22846841
2926
2927         Reviewed by Tim Horton.
2928
2929         Add new IOSurface format enum values, and set up the appropriate IOSurfaceCreate()
2930         property dictionaries for them.
2931
2932         * platform/graphics/cocoa/IOSurface.h:
2933         * platform/graphics/cocoa/IOSurface.mm:
2934         (IOSurface::IOSurface):
2935         * platform/spi/cocoa/IOSurfaceSPI.h:
2936
2937 2015-11-10  Brent Fulgham  <bfulgham@apple.com>
2938
2939         Crash running webaudio/panner-loop.html
2940         https://bugs.webkit.org/show_bug.cgi?id=150200
2941         <rdar://problem/23136282>
2942
2943         Reviewed by Jer Noble.
2944
2945         Test: webaudio/panner-loop.html
2946
2947         This is based on the changes in Blink r164822:
2948         https://codereview.chromium.org/130003002
2949
2950         Avoid infinitely recursing on audio nodes by keeping track of which nodes we've already
2951         visited.
2952
2953         * Modules/webaudio/PannerNode.cpp:
2954         (WebCore::PannerNode::pullInputs): Pass set of visited nodes so we don't revisit
2955         nodes we've already serviced.
2956         (WebCore::PannerNode::notifyAudioSourcesConnectedToNode): Accept visitedNodes argument
2957         so we can avoid revisiting nodes. Check if the current node has already been visited
2958         before processing it.
2959         * Modules/webaudio/PannerNode.h:
2960
2961 2015-11-10  Tim Horton  <timothy_horton@apple.com>
2962
2963         Adopt formal protocols for CA delegates
2964         https://bugs.webkit.org/show_bug.cgi?id=151121
2965         <rdar://problem/6739193>
2966
2967         Reviewed by Anders Carlsson.
2968
2969         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
2970         Note that our WebActionDisablingCALayerDelegate is, in fact, a CALayerDelegate.
2971
2972         * platform/spi/cocoa/QuartzCoreSPI.h:
2973         Add empty protocol definitions where necessary.
2974
2975         * WebCore.xcodeproj/project.pbxproj:
2976         * platform/spi/mac/NSAccessibilitySPI.h: Added.
2977         * platform/spi/mac/NSApplicationSPI.h: Added.
2978         * platform/spi/mac/NSTextFinderSPI.h: Added.
2979         * platform/spi/mac/NSViewSPI.h: Added.
2980         Split out SPI headers from WebKit2's AppKitSPI.h.
2981         Add NSViewSPI to note that NSView is (internally) a CALayerDelegate,
2982         which WebHTMLView depends on.
2983
2984 2015-11-10  Zalan Bujtas  <zalan@apple.com>
2985
2986         Continuations with anonymous wrappers inside misplaces child renderers.
2987         https://bugs.webkit.org/show_bug.cgi?id=150908
2988
2989         When a child is appended to an inline container and the beforeChild is not a direct child, but 
2990         it is inside a generated subtree, we need to special case the inline split to form continuation.
2991
2992         RenderInline::splitInlines() assumes that beforeChild is always a direct child of the current
2993         inline container. However when beforeChild type requires wrapper content (such as table cells), the DOM and the
2994         render tree get out of sync. In such cases, we need to ensure that both the beforeChild and its siblings end up
2995         in the correct generated block.
2996
2997         Reviewed by Darin Adler and David Hyatt.
2998
2999         Test: fast/inline/continuation-with-anon-wrappers.html
3000
3001         * rendering/RenderInline.cpp:
3002         (WebCore::RenderInline::splitInlines):
3003         (WebCore::RenderInline::addChildToContinuation):
3004
3005 2015-11-10  Geoffrey Garen  <ggaren@apple.com>
3006
3007         alert, confirm, prompt, showModalDialog should be forbidden during page close and navigation
3008         https://bugs.webkit.org/show_bug.cgi?id=150980
3009
3010         Reviewed by Chris Dumez.
3011
3012         Tests: fast/events/beforeunload-alert.html
3013                fast/events/beforeunload-confirm.html
3014                fast/events/beforeunload-prompt.html
3015                fast/events/beforeunload-showModalDialog.html
3016                fast/events/pagehide-alert.html
3017                fast/events/pagehide-confirm.html
3018                fast/events/pagehide-prompt.html
3019                fast/events/pagehide-showModalDialog.html
3020                fast/events/unload-alert.html
3021                fast/events/unload-confirm.html
3022                fast/events/unload-prompt.html
3023                fast/events/unload-showModalDialog.html
3024
3025         * loader/FrameLoader.cpp:
3026         (WebCore::FrameLoader::stopLoading): Factored out a helper function for
3027         unload event processing.
3028         (WebCore::FrameLoader::handleUnloadEvents): Forbid prompts in unload
3029         events just like we do in beforeunload events, and for the same reasons.
3030
3031         (WebCore::FrameLoader::handleBeforeUnloadEvent): Updated for renames.
3032
3033         * loader/FrameLoader.h:
3034
3035         * page/DOMWindow.cpp:
3036         (WebCore::DOMWindow::print):
3037         (WebCore::DOMWindow::alert):
3038         (WebCore::DOMWindow::confirm):
3039         (WebCore::DOMWindow::prompt):
3040         (WebCore::DOMWindow::showModalDialog): Updated for renames. Refactored
3041         some of this code to handle null pages more cleanly. In particular, we
3042         sometimes used to treat null page as "everything is permitted" -- but it
3043         is best practice in a permissions context to treat lack of information
3044         as no permission granted rather than all permissions granted. (I don't
3045         know of a way to trigger this condition in practice.)
3046
3047         * page/Page.cpp:
3048         (WebCore::Page::Page):
3049         (WebCore::Page::forbidPrompts):
3050         (WebCore::Page::allowPrompts):
3051         (WebCore::Page::arePromptsAllowed): Renamed to make these functions
3052         reflect their new, broader context.
3053
3054         (WebCore::Page::incrementFrameHandlingBeforeUnloadEventCount): Deleted.
3055         (WebCore::Page::decrementFrameHandlingBeforeUnloadEventCount): Deleted.
3056         (WebCore::Page::isAnyFrameHandlingBeforeUnloadEvent): Deleted.
3057
3058         * page/Page.h:
3059
3060 2015-11-09  David Hyatt  <hyatt@apple.com>
3061
3062         tate-chu-yoko should shrink to fit when it exceeds the available width.
3063         <rdar://problem/12130468>
3064         https://bugs.webkit.org/show_bug.cgi?id=151051
3065
3066         Reviewed by Myles Maxfield.
3067
3068         Covered by existing tests
3069
3070         * rendering/RenderCombineText.cpp:
3071         (WebCore::RenderCombineText::combineText):
3072
3073         When testing for text-combine, find the font variant that is the best fit, i.e.,
3074         that exceeds the available width by the smallest amount. Scale that best fit down
3075         repeatedly until it fits within the available space. We set a pixel size of 6 as
3076         the threshold at which we give up.
3077
3078         Also make sure to reset glyphOverflow on each measurement, as this was creating
3079         a potential bug both with variant checking and then with scaling, since glyphOverflow
3080         isn't reset when width() is invoked.
3081
3082 2015-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
3083
3084         Tatechuyoko text is not vertically centered in its vertical advance
3085         https://bugs.webkit.org/show_bug.cgi?id=151074
3086         <rdar://problem/20074305>
3087
3088         Reviewed by David Hyatt.
3089
3090         During paint time, the run origin of tatechuyoko needs to be adjusted to compensate for the
3091         rotation of the writing mode. The calculation which performed this adjustment was incorrect.
3092
3093         It is incorrect for two reasons:
3094         1. It used the existing text origin, which had the font's ascent incorporated in it, but did
3095         not compensate by either inspecting the overflow bounds' ascent nor the font's ascent proper.
3096         2. It did not distinguish between the overflow bounds' ascent vs. descent. Instead, it added
3097         them together and treated both values together.
3098
3099         No new tests yet. I need to make a font to test this.
3100
3101         * rendering/InlineTextBox.cpp:
3102         (WebCore::InlineTextBox::paint):
3103         * rendering/RenderCombineText.cpp:
3104         (WebCore::RenderCombineText::computeTextOrigin):
3105         (WebCore::RenderCombineText::combineText):
3106         (WebCore::RenderCombineText::adjustTextOrigin): Deleted.
3107         * rendering/RenderCombineText.h:
3108
3109 2015-11-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3110
3111         XMLHttpRequestUpload should support ontimeout event handler
3112         https://bugs.webkit.org/show_bug.cgi?id=128531
3113
3114         Reviewed by Darin Adler.
3115
3116         Covered by rebased tests.
3117
3118         * xml/XMLHttpRequestUpload.idl: Adding ontimeout event handler.
3119
3120 2015-11-10  Zalan Bujtas  <zalan@apple.com>
3121
3122         Force display: block on ::-webkit-media-controls.
3123         https://bugs.webkit.org/show_bug.cgi?id=149178
3124         <rdar://problem/23448397>
3125
3126         Reviewed by Simon Fraser.
3127
3128         This patch ensures that we always have a block level container for media controls
3129         so that continuation never needs to split RenderMedia into multiple subtrees.
3130
3131         Current inline continuation logic assumes that only inline elements with RenderInline
3132         type of renderers participate in continuation. This is mostly the case since other inline renderers
3133         such as RenderReplaced, RenderImage, RenderEmbeddedObject etc can't have (accessible) children.
3134         (Unlike video::-webkit-media-controls)
3135
3136         Test: media/webkit-media-controls-display.html
3137
3138         * Modules/mediacontrols/mediaControlsApple.css:
3139         (::-webkit-media-controls):
3140         * Modules/mediacontrols/mediaControlsiOS.css:
3141         (::-webkit-media-controls):
3142         * css/mediaControls.css:
3143         (::-webkit-media-controls):
3144
3145 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3146
3147         [GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
3148         https://bugs.webkit.org/show_bug.cgi?id=150642
3149
3150         Reviewed by Martin Robinson.
3151
3152         Remove GTK+ implementations of old context menu classes.
3153
3154         * PlatformGTK.cmake:
3155         * platform/ContextMenuItem.h:
3156         * platform/gtk/ContextMenuGtk.cpp: Removed.
3157         * platform/gtk/ContextMenuItemGtk.cpp: Removed.
3158
3159 2015-11-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3160
3161         [Streams API] Fix style issues
3162         https://bugs.webkit.org/show_bug.cgi?id=151089
3163
3164         Reviewed by Youenn Fablet.
3165
3166         Inlined some things, converted var into let and const, removed some undefined parameters and returns, added
3167         missing "use strict" clauses and other minor style changes.
3168
3169         Internal rework, no new tests needed.
3170
3171         * Modules/streams/ReadableStream.js:
3172         (initializeReadableStream):
3173         * Modules/streams/ReadableStreamController.js:
3174         (enqueue):
3175         (error):
3176         (close):
3177         * Modules/streams/ReadableStreamInternals.js:
3178         (teeReadableStream):
3179         (teeReadableStreamPullFunction):
3180         (teeReadableStreamBranch2CancelFunction):
3181         (errorReadableStream):
3182         (finishClosingReadableStream):
3183         (closeReadableStreamReader):
3184         (enqueueInReadableStream):
3185         (readFromReadableStreamReader):
3186         * Modules/streams/ReadableStreamReader.js:
3187         (releaseLock):
3188         * Modules/streams/StreamInternals.js:
3189         (invokeOrNoop):
3190         (promiseInvokeOrNoop):
3191         (promiseInvokeOrFallbackOrNoop):
3192         (validateAndNormalizeQueuingStrategy):
3193         (newQueue):
3194         (dequeueValue):
3195         (enqueueValueWithSize):
3196         (peekQueueValue):
3197         * Modules/streams/WritableStream.js:
3198         (initializeWritableStream):
3199         (abort):
3200         (close):
3201         * Modules/streams/WritableStreamInternals.js:
3202         (syncWritableStreamStateWithQueue):
3203         (errorWritableStream):
3204         (callOrScheduleWritableStreamAdvanceQueue):
3205         (writableStreamAdvanceQueue):
3206         (closeWritableStream): Deleted.
3207
3208 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3209
3210         Unreviewed. Fix scrollbars/custom-scrollbar-appearance-property.html after r191991.
3211
3212         Use a similar fix to the mac one.
3213
3214         * rendering/RenderThemeGtk.cpp:
3215         (WebCore::centerRectVerticallyInParentInputElement):
3216
3217 2015-11-10  Csaba Osztrogonác  <ossy@webkit.org>
3218
3219         Unreviewed speculative buildfix after r192200.
3220
3221         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
3222         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
3223
3224 2015-11-10  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3225
3226         [Streams API] Shield promises when prototype is replaced from a promise
3227         https://bugs.webkit.org/show_bug.cgi?id=151033
3228
3229         Reviewed by Darin Adler.
3230
3231         Instead of calling @then or @catch, that could have disappeared if the user successfully replaces a promise
3232         constructor, we call the methods stored at @Promise.prototype, which are safe as @Promise.prototype.@then.@call
3233         and @Promise.prototype.@catch.@call.
3234
3235         Test: streams/streams-promises.html, expectations updated.
3236
3237         * Modules/streams/ReadableStream.js:
3238         (initializeReadableStream):
3239         * Modules/streams/ReadableStreamInternals.js:
3240         (teeReadableStream):
3241         (teeReadableStreamPullFunction):
3242         (teeReadableStreamBranch2CancelFunction):
3243         (cancelReadableStream):
3244         * Modules/streams/WritableStream.js:
3245         (initializeWritableStream):
3246         (abort):
3247         * Modules/streams/WritableStreamInternals.js:
3248         (callOrScheduleWritableStreamAdvanceQueue):
3249
3250 2015-11-10  Jon Lee  <jonlee@apple.com>
3251
3252         REGRESSION (r189567): Inline controls on Mac are misplaced
3253         https://bugs.webkit.org/show_bug.cgi?id=151072
3254
3255         Reviewed by Eric Carlson.
3256
3257         Test: media/controls/fullscreen-button-inline-layout.html
3258
3259         For a certain range of video widths, r189567 caused the timeline track to be
3260         too large, pushing the buttons on the right side of the inline controls out of
3261         the rect bounds.
3262
3263         The fix is to set min-width to 0. The test added checks to see that the right
3264         edge of the fullscreen button is within the rect bounds.
3265
3266         * Modules/mediacontrols/mediaControlsApple.css:
3267         (audio::-webkit-media-controls-timeline-container): Add min-width.
3268         (audio::-webkit-media-controls-panel .thumbnail-track): Ditto. Fly-by fix of height rule.
3269
3270 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
3271
3272         [Mac] Add a mock AppleTV device for testing
3273         https://bugs.webkit.org/show_bug.cgi?id=148912
3274         <rdar://problem/22596272>
3275
3276         Reviewed by Tim Horton.
3277
3278         No new tests, updated media/controls/airplay-picker.html.
3279
3280         * Modules/mediasession/WebMediaSessionManager.cpp:
3281         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled): New, enable or disable
3282           the mock picker.
3283         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState): New, set mock picker state.
3284         (WebCore::WebMediaSessionManager::mockPicker): New.
3285         (WebCore::WebMediaSessionManager::targetPicker): Return the platform or mock picker, as per settings.
3286         (WebCore::webMediaSessionManagerOverride): Deleted.
3287         (WebCore::WebMediaSessionManager::shared): Deleted.
3288         (WebCore::WebMediaSessionManager::setWebMediaSessionManagerOverride): Deleted.
3289         * Modules/mediasession/WebMediaSessionManager.h:
3290
3291         * WebCore.xcodeproj/project.pbxproj: Add MediaPlaybackTargetPickerMock.* and MediaPlaybackTargetMock.*.
3292
3293         * page/ChromeClient.h: add setMockMediaPlaybackTargetPickerEnabled and setMockMediaPlaybackTargetPickerState.
3294
3295         * page/Page.cpp:
3296         (WebCore::Page::playbackTargetPickerClientStateDidChange):
3297         (WebCore::Page::setMockMediaPlaybackTargetPickerEnabled): New.
3298         (WebCore::Page::setMockMediaPlaybackTargetPickerState): New.
3299         (WebCore::Page::setPlaybackTarget):
3300         * page/Page.h:
3301
3302         * platform/graphics/MediaPlaybackTarget.h:
3303         (WebCore::noMediaPlaybackTargetContext):
3304         (WebCore::MediaPlaybackTarget::~MediaPlaybackTarget):
3305         (WebCore::MediaPlaybackTarget::deviceName):
3306         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
3307
3308         * platform/graphics/MediaPlaybackTargetContext.h: Make a class instead of a struct.
3309         (WebCore::MediaPlaybackTargetContext::MediaPlaybackTargetContext):
3310         (WebCore::MediaPlaybackTargetContext::type):
3311         (WebCore::MediaPlaybackTargetContext::mockDeviceName):
3312         (WebCore::MediaPlaybackTargetContext::mockState):
3313         (WebCore::MediaPlaybackTargetContext::avOutputContext):
3314         (WebCore::MediaPlaybackTargetContext::encodingRequiresPlatformData):
3315
3316         * platform/graphics/MediaPlaybackTargetPicker.cpp: Move much of the code from MediaPlaybackTargetMac.mm
3317           here so it can be the base class.
3318         (WebCore::MediaPlaybackTargetPicker::MediaPlaybackTargetPicker):
3319         (WebCore::MediaPlaybackTargetPicker::~MediaPlaybackTargetPicker):
3320         (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
3321         (WebCore::MediaPlaybackTargetPicker::addPendingAction):
3322         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
3323         * platform/graphics/MediaPlaybackTargetPicker.h:
3324         (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
3325         (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
3326         (WebCore::MediaPlaybackTargetPicker::client):
3327         (WebCore::MediaPlaybackTargetPicker::setClient):
3328
3329         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h:
3330         (WebCore::MediaPlaybackTargetMac::outputContext):
3331         (WebCore::MediaPlaybackTargetMac::targetType): Deleted.
3332         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
3333         (WebCore::MediaPlaybackTargetMac::targetContext):
3334         (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
3335         (WebCore::MediaPlaybackTargetMac::deviceName):
3336
3337         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
3338         (WebCore::WebMediaSessionManager::shared): Renamed from platformManager.
3339         (WebCore::WebMediaSessionManagerMac::platformPicker): Renamed from targetPicker.
3340         (WebCore::WebMediaSessionManager::platformManager): Deleted.
3341         (WebCore::WebMediaSessionManagerMac::targetPicker): Deleted.
3342         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
3343
3344         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3345         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3346         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
3347         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
3348         (WebCore::MediaPlaybackTargetPickerMac::externalOutputDeviceAvailable):
3349         (WebCore::MediaPlaybackTargetPickerMac::playbackTarget):
3350         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
3351         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
3352         (WebCore::MediaPlaybackTargetPickerMac::startingMonitoringPlaybackTargets):
3353         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Deleted.
3354         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Deleted.
3355         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): Deleted.
3356         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Deleted.
3357
3358         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3359         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3360         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless): Add support for
3361           mock target.
3362         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Ditto.
3363         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Ditto.
3364         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Ditto.
3365
3366         * platform/mock/MediaPlaybackTargetMock.cpp: Added.
3367         (WebCore::MediaPlaybackTargetMock::create): 
3368         (WebCore::MediaPlaybackTargetMock::MediaPlaybackTargetMock):
3369         (WebCore::MediaPlaybackTargetMock::~MediaPlaybackTargetMock):
3370         (WebCore::MediaPlaybackTargetMock::targetContext):
3371         (WebCore::toMediaPlaybackTargetMock):
3372         * platform/mock/MediaPlaybackTargetMock.h: Added.
3373
3374         * platform/mock/MediaPlaybackTargetPickerMock.cpp: Added.
3375         (WebCore::MediaPlaybackTargetPickerMock::create):
3376         (WebCore::MediaPlaybackTargetPickerMock::MediaPlaybackTargetPickerMock):
3377         (WebCore::MediaPlaybackTargetPickerMock::~MediaPlaybackTargetPickerMock):
3378         (WebCore::MediaPlaybackTargetPickerMock::externalOutputDeviceAvailable):
3379         (WebCore::MediaPlaybackTargetPickerMock::playbackTarget):
3380         (WebCore::MediaPlaybackTargetPickerMock::timerFired):
3381         (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
3382         (WebCore::MediaPlaybackTargetPickerMock::startingMonitoringPlaybackTargets):
3383         (WebCore::MediaPlaybackTargetPickerMock::stopMonitoringPlaybackTargets):
3384         (WebCore::MediaPlaybackTargetPickerMock::invalidatePlaybackTargets):
3385         (WebCore::MediaPlaybackTargetPickerMock::setState):
3386         * platform/mock/MediaPlaybackTargetPickerMock.h: Added.
3387
3388         * testing/Internals.cpp:
3389         (WebCore::Internals::Internals):
3390         (WebCore::Internals::setMockMediaPlaybackTargetPickerEnabled):
3391         (WebCore::Internals::setMockMediaPlaybackTargetPickerState):
3392         * testing/Internals.h:
3393         * testing/Internals.idl:
3394
3395 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3396
3397         Unreviewed, fix the windows build
3398
3399         Update the signature of scrollableAreaBoundingBox, changed by r192193.
3400
3401         * platform/win/PopupMenuWin.cpp:
3402         (WebCore::PopupMenuWin::scrollableAreaBoundingBox):
3403         * platform/win/PopupMenuWin.h:
3404
3405 2015-11-09  Simon Fraser  <simon.fraser@apple.com>
3406
3407         Allow iOS to create linearRGB colorspaces
3408         https://bugs.webkit.org/show_bug.cgi?id=151059
3409
3410         Reviewed by Tim Horton.
3411
3412         Remove iOS #ifdefs around code that creates linearized RGB colorspaces, as used
3413         by SVG filters. Blending doesn't actually work correctly, but there's no reason
3414         to #ifdef differently here.
3415
3416         * platform/graphics/cg/GraphicsContextCG.cpp:
3417         * platform/graphics/mac/GraphicsContextMac.mm:
3418         (WebCore::linearRGBColorSpaceRef):
3419
3420 2015-11-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3421
3422         Sometimes unable to scroll fixed div when the body is scrollable
3423         https://bugs.webkit.org/show_bug.cgi?id=151015
3424         <rdar://problem/23445723>
3425
3426         Reviewed by Simon Fraser.
3427
3428         Currently, if we scroll a page containing a fixed scrollable area, the non-fast-scrollable region corresponding to a fixed
3429         area will not move down to reflect its new bounds in absolute coordinates, making it impossible to scroll position: fixed
3430         overflow elements when the body's scroll position changes. To fix this, we inflate the non-fast-scrollable region
3431         corresponding to scrollable position: fixed elements such that their regions encompass the area, relative to the page,
3432         wherein the fixed element may lie when the page is scrolled by any amount within its scroll limits.
3433
3434         We also optimize the non-fast-scrollable regions emitted by elements that handle wheel events. Currently, if a fixed element
3435         also has a wheel event handler, we take the entire document's rect to be non-fast-scrollable. This patch changes this region
3436         to behave the same way as fixed scrollable elements above.
3437
3438         This patch also folds some common logic used to accomplish this into FrameView for use by RenderLayerCompositor and RenderView.
3439
3440         Test: tiled-drawing/scrolling/non-fast-region/fixed-div-in-scrollable-page.html
3441
3442         * page/FrameView.cpp:
3443         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling):
3444         (WebCore::FrameView::scrollOffsetRespectingCustomFixedPosition):
3445         * page/FrameView.h:
3446         * page/scrolling/ScrollingCoordinator.cpp:
3447         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
3448         * platform/ScrollableArea.h:
3449         (WebCore::ScrollableArea::scrollableAreaBoundingBox):
3450         * rendering/RenderLayer.cpp:
3451         (WebCore::RenderLayer::scrollableAreaBoundingBox):
3452         * rendering/RenderLayer.h:
3453         * rendering/RenderLayerCompositor.cpp:
3454         (WebCore::RenderLayerCompositor::computeExtent):
3455         (WebCore::fixedPositionOffset): Deleted.
3456         * rendering/RenderView.cpp:
3457         (WebCore::RenderView::mapLocalToContainer):
3458         (WebCore::RenderView::pushMappingToContainer):
3459         (WebCore::RenderView::mapAbsoluteToLocalPoint):
3460         (WebCore::RenderView::computeRectForRepaint):
3461         (WebCore::fixedPositionOffset): Deleted.
3462
3463 2015-11-09  Ryan Haddad  <ryanhaddad@apple.com>
3464
3465         Unreviewed, rolling out r192181.
3466
3467         This change causes asserts on mac-wk1 debug testers
3468
3469         Reverted changeset:
3470
3471         "Fixed crash loading Mozilla layout test
3472         editor/libeditor/crashtests/431086-1.xhtml."
3473         https://bugs.webkit.org/show_bug.cgi?id=150252
3474         http://trac.webkit.org/changeset/192181
3475
3476 2015-11-09  Jiewen Tan  <jiewen_tan@apple.com>
3477
3478         Crash when right clicking in input box with -webkit-user-select: none
3479         https://bugs.webkit.org/show_bug.cgi?id=145981
3480         <rdar://problem/22441925>