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