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