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