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