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