e5c4534ea1eedbefaf0b31450d84080cf6f96e43
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-11-30  Simon Fraser  <simon.fraser@apple.com>
2
3         Fix possible crash with animated layers in reflections
4         https://bugs.webkit.org/show_bug.cgi?id=151689
5         rdar://problem/23018612
6
7         Reviewed by Darin Adler.
8
9         Reflections create additional PlatformCALayers whose owner is set to the GraphicsLayerCA.
10         Those PlatformCALayers need their owner pointer cleared out when the GraphicsLayerCA
11         is destroyed.
12         
13         Tested by compositing/reflections/nested-reflection-transition.html
14
15         * platform/graphics/ca/GraphicsLayerCA.cpp:
16         * platform/graphics/ca/GraphicsLayerCA.h:
17
18 2015-11-30  Brady Eidson  <beidson@apple.com>
19
20         Modern IDB: Iterating index cursors to a specific key is busted.
21         https://bugs.webkit.org/show_bug.cgi?id=151684
22
23         Reviewed by Darin Adler.
24
25         No new tests (At least one failing test now passes).
26
27         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
28         (WebCore::IDBServer::MemoryIndexCursor::iterate):
29
30 2015-11-30  Brady Eidson  <beidson@apple.com>
31
32         Modern IDB: ObjectStore cursors should not be able to iterate out of their range.
33         https://bugs.webkit.org/show_bug.cgi?id=151683
34
35         Reviewed by Darin Adler.
36
37         No new tests (Covered by at least one failing test that now passes).
38
39         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
40         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
41         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
42
43 2015-11-30  Anders Carlsson  <andersca@apple.com>
44
45         CTTE autogenerated bindings code
46         https://bugs.webkit.org/show_bug.cgi?id=151682
47
48         Reviewed by Darin Adler.
49
50         Make sure that JS bindings pass a reference to the object when calling static member functions.
51
52         * Modules/gamepad/NavigatorGamepad.cpp:
53         (WebCore::NavigatorGamepad::getGamepads):
54         * Modules/gamepad/NavigatorGamepad.h:
55         * Modules/geolocation/NavigatorGeolocation.cpp:
56         (WebCore::NavigatorGeolocation::geolocation):
57         * Modules/geolocation/NavigatorGeolocation.h:
58         * Modules/mediasource/AudioTrackMediaSource.h:
59         (WebCore::AudioTrackMediaSource::sourceBuffer):
60         * Modules/mediasource/TextTrackMediaSource.h:
61         (WebCore::TextTrackMediaSource::sourceBuffer):
62         * Modules/mediasource/VideoTrackMediaSource.h:
63         (WebCore::VideoTrackMediaSource::sourceBuffer):
64         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
65         (WebCore::HTMLMediaElementMediaStream::srcObject):
66         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
67         * Modules/mediastream/HTMLMediaElementMediaStream.h:
68         * Modules/mediastream/NavigatorMediaDevices.cpp:
69         (WebCore::NavigatorMediaDevices::mediaDevices):
70         * Modules/mediastream/NavigatorMediaDevices.h:
71         * Modules/notifications/DOMWindowNotifications.cpp:
72         (WebCore::DOMWindowNotifications::webkitNotifications):
73         * Modules/notifications/DOMWindowNotifications.h:
74         * Modules/notifications/Notification.cpp:
75         (WebCore::Notification::Notification):
76         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
77         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
78         * Modules/notifications/WorkerGlobalScopeNotifications.h:
79         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
80         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
81         * Modules/speech/DOMWindowSpeechSynthesis.h:
82         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
83         (WebCore::DOMWindowWebDatabase::openDatabase):
84         * Modules/webdatabase/DOMWindowWebDatabase.h:
85         * bindings/scripts/CodeGeneratorJS.pm:
86         (GenerateImplementation):
87         (GenerateParametersCheck):
88         * testing/Internals.cpp:
89         (WebCore::Internals::enableMockSpeechSynthesizer):
90
91 2015-11-30  Katlyn Graff  <kgraff@apple.com>
92
93         Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
94         https://bugs.webkit.org/show_bug.cgi?id=151677
95
96         Reviewed by Ryosuke Niwa.
97
98         Simply a refactoring patch, so no new tests.
99
100         * Modules/encryptedmedia/MediaKeySession.cpp:
101         (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
102         (WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
103         * Modules/encryptedmedia/MediaKeySession.h:
104         * Modules/geolocation/Geolocation.cpp:
105         (WebCore::Geolocation::canSuspendForDocumentSuspension):
106         (WebCore::Geolocation::canSuspendForPageCache): Deleted.
107         * Modules/geolocation/Geolocation.h:
108         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
109         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
110         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
111         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
112         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
113         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
114         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
115         (WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
116         (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
117         * Modules/indexeddb/client/IDBDatabaseImpl.h:
118         * Modules/indexeddb/client/IDBRequestImpl.cpp:
119         (WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
120         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
121         * Modules/indexeddb/client/IDBRequestImpl.h:
122         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
123         (WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
124         (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
125         * Modules/indexeddb/client/IDBTransactionImpl.h:
126         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
127         (WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
128         (WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
129         * Modules/indexeddb/legacy/LegacyDatabase.h:
130         * Modules/indexeddb/legacy/LegacyRequest.cpp:
131         (WebCore::LegacyRequest::canSuspendForDocumentSuspension):
132         (WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
133         * Modules/indexeddb/legacy/LegacyRequest.h:
134         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
135         (WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
136         (WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
137         * Modules/indexeddb/legacy/LegacyTransaction.h:
138         * Modules/mediasource/MediaSource.cpp:
139         (WebCore::MediaSource::canSuspendForDocumentSuspension):
140         (WebCore::MediaSource::canSuspendForPageCache): Deleted.
141         * Modules/mediasource/MediaSource.h:
142         * Modules/mediasource/SourceBuffer.cpp:
143         (WebCore::SourceBuffer::canSuspendForDocumentSuspension):
144         (WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
145         * Modules/mediasource/SourceBuffer.h:
146         * Modules/mediastream/MediaStreamTrack.cpp:
147         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
148         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
149         * Modules/mediastream/MediaStreamTrack.h:
150         * Modules/mediastream/RTCDTMFSender.cpp:
151         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
152         (WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
153         * Modules/mediastream/RTCDTMFSender.h:
154         * Modules/mediastream/RTCPeerConnection.cpp:
155         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
156         (WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
157         * Modules/mediastream/RTCPeerConnection.h:
158         * Modules/notifications/DOMWindowNotifications.cpp:
159         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
160         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
161         (WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
162         (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
163         * Modules/notifications/DOMWindowNotifications.h:
164         * Modules/notifications/Notification.cpp:
165         (WebCore::Notification::canSuspendForDocumentSuspension):
166         (WebCore::Notification::canSuspendForPageCache): Deleted.
167         * Modules/notifications/Notification.h:
168         * Modules/notifications/NotificationCenter.cpp:
169         (WebCore::NotificationCenter::canSuspendForDocumentSuspension):
170         (WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
171         * Modules/notifications/NotificationCenter.h:
172         * Modules/webaudio/AudioContext.cpp:
173         (WebCore::AudioContext::canSuspendForDocumentSuspension):
174         (WebCore::AudioContext::canSuspendForPageCache): Deleted.
175         * Modules/webaudio/AudioContext.h:
176         * Modules/webdatabase/DatabaseContext.cpp:
177         (WebCore::DatabaseContext::canSuspendForDocumentSuspension):
178         (WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
179         * Modules/webdatabase/DatabaseContext.h:
180         * Modules/websockets/WebSocket.cpp:
181         (WebCore::WebSocket::canSuspendForDocumentSuspension):
182         (WebCore::WebSocket::canSuspendForPageCache): Deleted.
183         * Modules/websockets/WebSocket.h:
184         * css/FontLoader.cpp:
185         (WebCore::FontLoader::canSuspendForDocumentSuspension):
186         (WebCore::FontLoader::canSuspendForPageCache): Deleted.
187         * css/FontLoader.h:
188         * dom/ActiveDOMObject.cpp:
189         (WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
190         (WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
191         * dom/ActiveDOMObject.h:
192         * dom/Document.cpp:
193         (WebCore::Document::~Document):
194         * dom/ScriptExecutionContext.cpp:
195         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
196         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
197         * dom/ScriptExecutionContext.h:
198         * fileapi/FileReader.cpp:
199         (WebCore::FileReader::canSuspendForDocumentSuspension):
200         (WebCore::FileReader::canSuspendForPageCache): Deleted.
201         * fileapi/FileReader.h:
202         * history/CachedFrame.cpp:
203         (WebCore::CachedFrame::CachedFrame):
204         * history/PageCache.cpp:
205         (WebCore::canCacheFrame):
206         * html/HTMLMarqueeElement.cpp:
207         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
208         (WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
209         * html/HTMLMarqueeElement.h:
210         * html/HTMLMediaElement.cpp:
211         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
212         (WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
213         * html/HTMLMediaElement.h:
214         * html/HTMLSourceElement.cpp:
215         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
216         (WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
217         * html/HTMLSourceElement.h:
218         * html/PublicURLManager.cpp:
219         (WebCore::PublicURLManager::canSuspendForDocumentSuspension):
220         (WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
221         * html/PublicURLManager.h:
222         * html/canvas/WebGLRenderingContextBase.cpp:
223         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
224         (WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
225         * html/canvas/WebGLRenderingContextBase.h:
226         * loader/FrameLoader.cpp:
227         (WebCore::FrameLoader::clear):
228         (WebCore::FrameLoader::open):
229         * loader/appcache/DOMApplicationCache.cpp:
230         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
231         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
232         (WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
233         (WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
234         * loader/appcache/DOMApplicationCache.h:
235         * page/DOMWindow.cpp:
236         (WebCore::DOMWindow::DOMWindow):
237         (WebCore::DOMWindow::~DOMWindow):
238         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
239         (WebCore::DOMWindow::suspendForDocumentSuspension):
240         (WebCore::DOMWindow::resumeFromDocumentSuspension):
241         (WebCore::DOMWindow::disconnectDOMWindowProperties):
242         (WebCore::DOMWindow::reconnectDOMWindowProperties):
243         (WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
244         (WebCore::DOMWindow::suspendForPageCache): Deleted.
245         (WebCore::DOMWindow::resumeFromPageCache): Deleted.
246         * page/DOMWindow.h:
247         * page/DOMWindowExtension.cpp:
248         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
249         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
250         (WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
251         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
252         * page/DOMWindowExtension.h:
253         * page/DOMWindowProperty.cpp:
254         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
255         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
256         (WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
257         (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
258         * page/DOMWindowProperty.h:
259         * page/EventSource.cpp:
260         (WebCore::EventSource::canSuspendForDocumentSuspension):
261         (WebCore::EventSource::canSuspendForPageCache): Deleted.
262         * page/EventSource.h:
263         * page/SuspendableTimer.cpp:
264         (WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
265         (WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
266         * page/SuspendableTimer.h:
267         * workers/Worker.cpp:
268         (WebCore::Worker::canSuspendForDocumentSuspension):
269         (WebCore::Worker::canSuspendForPageCache): Deleted.
270         * workers/Worker.h:
271         * xml/XMLHttpRequest.cpp:
272         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
273         (WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
274         * xml/XMLHttpRequest.h:
275
276 2015-11-30  Brady Eidson  <beidson@apple.com>
277
278         Modern IDB: "prevunique" cursors should point at the lowest primary key that matches, not the highest.
279         https://bugs.webkit.org/show_bug.cgi?id=151675.
280
281         Reviewed by Darin Adler.
282
283         No new tests (Covered by at least one failing test that now passes, and updates to previously incorrect tests).
284
285         * Modules/indexeddb/server/IndexValueEntry.cpp:
286         (WebCore::IDBServer::IndexValueEntry::reverseBegin): If CursorDuplicity is NoDuplicates, start at the lowest
287           entry instead of the highest.
288         (WebCore::IDBServer::IndexValueEntry::reverseFind):
289         * Modules/indexeddb/server/IndexValueEntry.h:
290         
291         * Modules/indexeddb/server/IndexValueStore.cpp:
292         (WebCore::IDBServer::IndexValueStore::reverseFind):
293         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
294         (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
295         * Modules/indexeddb/server/IndexValueStore.h:
296         
297         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
298         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
299         (WebCore::IDBServer::MemoryIndexCursor::iterate):
300         
301         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
302         (WebCore::IDBCursorInfo::duplicity):
303         (WebCore::IDBCursorInfo::isDirectionNoDuplicate): Deleted.
304         * Modules/indexeddb/shared/IDBCursorInfo.h:
305
306 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
307
308         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
309         https://bugs.webkit.org/show_bug.cgi?id=149309
310         <rdar://problem/22748363>
311
312         Reviewed by Brent Fulgham.
313
314         A weird order of event execution introduced by the test case will kill the webpage in a
315         subframe of the page while executing its |frame.loader().checkLoadCompleteForThisFrame()|.
316         Therefore, any frames comes after the failing subframe will have no page. Check it before
317         calling to those frames' |frame.loader().checkLoadCompleteForThisFrame()|, otherwise the
318         assertion in |frame.loader().checkLoadCompleteForThisFrame()| will fail.
319
320         Test: http/tests/misc/detach-during-notifyDone.html
321
322         * loader/FrameLoader.cpp:
323         (WebCore::FrameLoader::checkLoadComplete):
324
325 2015-11-30  Commit Queue  <commit-queue@webkit.org>
326
327         Unreviewed, rolling out r192819.
328         https://bugs.webkit.org/show_bug.cgi?id=151681
329
330         This change broke existing layout tests on Windows (Requested
331         by ryanhaddad on #webkit).
332
333         Reverted changeset:
334
335         "Unify font-variant-* with font-variant shorthand"
336         https://bugs.webkit.org/show_bug.cgi?id=149773
337         http://trac.webkit.org/changeset/192819
338
339 2015-11-30  Darin Adler  <darin@apple.com>
340
341         Use Optional instead of isNull out argument for nullable getters
342         https://bugs.webkit.org/show_bug.cgi?id=151676
343
344         Reviewed by Anders Carlsson.
345
346         No behavior change, just cleaner code.
347
348         * Modules/geolocation/Coordinates.cpp:
349         (WebCore::Coordinates::altitude): Return an Optional.
350         (WebCore::Coordinates::altitudeAccuracy): Ditto.
351         (WebCore::Coordinates::heading): Ditto.
352         (WebCore::Coordinates::speed): Ditto.
353         * Modules/geolocation/Coordinates.h: Ditto.
354
355         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
356         (WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
357         through to Event::create, which is clearly not what was wanted. Also removed
358         unneeded explicit destructor.
359         * Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
360         to Optional and updated for above change.
361
362         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
363         (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
364         an Optional.
365         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
366         default argument values; the event type one, at least, was clearly incorrect.
367         Made more things private, got rid of unneeded destructor, marked class final
368         instead of marking all functions final.
369
370         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
371         (WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
372         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.
373
374         * Modules/mediastream/MediaTrackConstraints.cpp:
375         (WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
376         come back to finish later we will have to implement optional return values
377         for arrays in the JavaScript bindings generator, which should be straightforward.
378         * Modules/mediastream/MediaTrackConstraints.h: Ditto.
379
380         * bindings/js/JSDOMBinding.h:
381         (WebCore::toNullableJSNumber): Added. This function template is used for
382         return values that are nullable numbers.
383
384         * bindings/scripts/CodeGeneratorGObject.pm:
385         (GenerateFunction): Replaced some existing bogus code to handle nullables with
386         new equally-bogus code that should be no worse and will compile.
387
388         * bindings/scripts/CodeGeneratorJS.pm:
389         (GenerateImplementation): Removed old support for nullables.
390         (NativeToJSValue): Added new support for nullable numbers.
391
392         * bindings/scripts/CodeGeneratorObjC.pm:
393         (GenerateImplementation): Removed support for nullables. We almost certainly
394         won't need it for Objective-C bindings.
395
396         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
397         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
398         * bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.
399
400 2015-11-30  Wenson Hsieh  <wenson_hsieh@apple.com>
401
402         Split platform-independent logic in AVCaptureDeviceManager out into a new class
403         https://bugs.webkit.org/show_bug.cgi?id=151388
404         <rdar://problem/23593980>
405
406         Reviewed by Eric Carlson.
407
408         To prepare for creating a MockCaptureDeviceManager to be able to test
409         MediaDevices.getUserMedia, we create a platform-independent capture device manager
410         which all platforms should extend and add platform-specific logic to.
411
412         The methods CaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints and
413         CaptureDeviceManager::captureDeviceList should be overridden by each platform
414         CaptureDeviceManager to respectively create a RealtimeMediaSource and return a list of
415         capture devices. createMediaSourceForCaptureDeviceWithConstraints attempts to create
416         a media source for a given device with some constraints; if the contraints cannot be
417         satisfied, this returns null.
418
419         The refactored capture device manager also introduces the notion of a platform-
420         independent capture session which may be extended by platform device managers for
421         determining whether a given constraint name, value and media type is valid.
422
423         A platform-independent CaptureDeviceInfo now represents either the video or audio
424         component of a capture device, but not both at once. This means a capture device that
425         supports both video and audio will emit two separate capture devices.
426
427         No new tests, since there should be no behavior change.
428
429         * Modules/mediastream/CaptureDeviceInfo.h: Added.
430         (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
431         (WebCore::CaptureSessionInfo::supportsVideoSize):
432         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
433         * Modules/mediastream/CaptureDeviceManager.cpp: Added.
434         (CaptureDeviceManager::~CaptureDeviceManager):
435         (CaptureDeviceManager::getSourcesInfo):
436         (CaptureDeviceManager::captureDeviceFromDeviceID):
437         (CaptureDeviceManager::verifyConstraintsForMediaType):
438         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
439         (CaptureDeviceManager::sourceWithUID):
440         (CaptureDeviceManager::bestDeviceForFacingMode):
441         (facingModeFromString):
442         (CaptureDeviceManager::sessionSupportsConstraint):
443         (CaptureDeviceManager::isSupportedFrameRate):
444         * Modules/mediastream/CaptureDeviceManager.h: Added.
445         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList):
446         (WebCore::CaptureDeviceManager::defaultCaptureSession):
447         * WebCore.xcodeproj/project.pbxproj:
448         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Added.
449         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
450         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName):
451         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
452         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
453         * platform/mediastream/mac/AVCaptureDeviceManager.h:
454         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
455         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo):
456         (WebCore::AVCaptureSessionInfo::supportsVideoSize):
457         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions):
458         (WebCore::AVCaptureDeviceManager::captureDeviceList):
459         (WebCore::shouldConsiderDeviceInDeviceList):
460         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
461         (WebCore::AVCaptureDeviceManager::AVCaptureDeviceManager):
462         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
463         (WebCore::AVCaptureDeviceManager::sourceWithUID):
464         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
465         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType):
466         (WebCore::AVCaptureDeviceManager::defaultCaptureSession):
467         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint):
468         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
469         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
470         (WebCore::AVCaptureDeviceManager::isSupportedFrameRate):
471         (WebCore::CaptureDevice:::m_enabled): Deleted.
472         (WebCore::captureDeviceList): Deleted.
473         (WebCore::captureDeviceFromDeviceID): Deleted.
474         (WebCore::refreshCaptureDeviceList): Deleted.
475         (WebCore::AVCaptureDeviceManager::bestSessionPresetForVideoSize): Deleted.
476         (WebCore::AVCaptureDeviceManager::deviceSupportsFacingMode): Deleted.
477         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Deleted.
478         (WebCore::AVCaptureDeviceManager::isValidConstraint): Deleted.
479         (WebCore::AVCaptureDeviceManager::validConstraintNames): Deleted.
480         (WebCore::AVCaptureDeviceManager::validFacingModes): Deleted.
481         * platform/mediastream/mac/AVVideoCaptureSource.mm:
482         (WebCore::AVVideoCaptureSource::applyConstraints):
483         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
484         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
485         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
486
487 2015-11-30  Brady Eidson  <beidson@apple.com>
488
489         Modern IDB: Set the correct source on the IDBRequest for cursor updates
490         https://bugs.webkit.org/show_bug.cgi?id=151665
491
492         Reviewed by Andy Estes.
493
494         No new tests (At least one existing failing test now passes).
495
496         * Modules/indexeddb/client/IDBCursorImpl.cpp:
497         (WebCore::IDBClient::IDBCursor::update):
498         
499         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
500         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
501         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
502         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
503         
504         * Modules/indexeddb/client/IDBRequestImpl.cpp:
505         (WebCore::IDBClient::IDBRequest::IDBRequest):
506         (WebCore::IDBClient::IDBRequest::setSource):
507         * Modules/indexeddb/client/IDBRequestImpl.h:
508
509 2015-11-30  Tim Horton  <timothy_horton@apple.com>
510
511         Get rid of the legacy TextIndicatorWindow style
512         https://bugs.webkit.org/show_bug.cgi?id=151674
513
514         Reviewed by Anders Carlsson.
515
516         * page/TextIndicator.h:
517         * page/mac/TextIndicatorWindow.mm:
518         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Deleted.
519
520 2015-11-30  Brady Eidson  <beidson@apple.com>
521
522         Modern IDB: Correct handling of cursors finishing iteration.
523         https://bugs.webkit.org/show_bug.cgi?id=151664
524
525         Reviewed by Andy Estes.
526
527         No new tests (At least one previously failing test now passes).
528
529         * Modules/indexeddb/client/IDBCursorImpl.cpp:
530         (WebCore::IDBClient::IDBCursor::setGetResult):
531         
532         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
533         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
534
535 2015-11-30  Myles C. Maxfield  <mmaxfield@apple.com>
536
537         Unify font-variant-* with font-variant shorthand
538         https://bugs.webkit.org/show_bug.cgi?id=149773
539
540         Reviewed by Darin Adler.
541
542         This patch makes font-variant a shorthand for the following properties:
543         font-variant-ligatures
544         font-variant-position
545         font-variant-caps
546         font-variant-numeric
547         font-variant-alternates
548         font-variant-east-asian
549
550         This is consistent with the CSS Fonts Level 3 spec.
551
552         This patch also migrates the "font" longhand to use the font-variant-caps
553         property.
554
555         Test: fast/text/font-variant-shorthand.html
556
557         * css/CSSComputedStyleDeclaration.cpp:
558         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
559         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
560         font-variant computed style.
561         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
562         the font shorthand.
563         * css/CSSFontSelector.cpp:
564         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
565         of the new shorthand property).
566         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
567         (WebCore::CSSParser::parseValue):
568         (WebCore::CSSParser::parseFont):
569         (WebCore::CSSParser::parseSystemFont):
570         (WebCore::CSSParser::parseFontVariantLigatures):
571         (WebCore::CSSParser::parseFontVariantNumeric):
572         (WebCore::CSSParser::parseFontVariantEastAsian):
573         (WebCore::CSSParser::parseFontVariant):
574         (WebCore::isValidKeywordPropertyAndValue): Deleted.
575         (WebCore::isKeywordPropertyID): Deleted.
576         * css/CSSParser.h:
577         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
578         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
579         FontVariantEastAsian type.
580         (WebCore::applyValueFontVariantLigatures):
581         (WebCore::applyValueFontVariantNumeric):
582         (WebCore::applyValueFontVariantEastAsian):
583         * css/StyleProperties.cpp: Update to use the more specific property.
584         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
585         (WebCore::StyleProperties::fontValue):
586         (WebCore::StyleProperties::asText):
587         * css/StyleResolver.cpp: Ditto.
588         (WebCore::StyleResolver::isValidCueStyleProperty):
589         * editing/EditingStyle.cpp: Ditto.
590         * editing/cocoa/HTMLConverter.mm: Ditto.
591         (HTMLConverterCaches::propertyValueForNode):
592         (HTMLConverter::computedAttributesForElement):
593         * editing/ios/EditorIOS.mm: Ditto.
594         (WebCore::Editor::removeUnchangeableStyles):
595         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
596         (WebCore::CanvasRenderingContext2D::font):
597         (WebCore::CanvasRenderingContext2D::setFont):
598         * platform/graphics/FontCache.h: Removing duplicate cache key value.
599         (WebCore::FontDescriptionKey::makeFlagsKey):
600         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
601         (WebCore::FontCascade::glyphDataForCharacter):
602         * platform/graphics/FontCascade.h: Ditto.
603         (WebCore::FontCascade::isSmallCaps):
604         * platform/graphics/FontDescription.cpp: Ditto.
605         (WebCore::FontDescription::FontDescription):
606         * platform/graphics/FontDescription.h: Ditto.
607         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
608         (WebCore::FontDescription::smallCaps): Deleted.
609         (WebCore::FontDescription::setSmallCaps): Deleted.
610         (WebCore::FontDescription::setIsSmallCaps): Deleted.
611         (WebCore::FontDescription::operator==): Deleted.
612         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
613         (WebCore::computeFeatureSettingsFromVariants):
614         * platform/text/TextFlags.h: Ditto.
615         (WebCore::FontVariantSettings::operator==):
616         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
617         (WebCore::RenderText::widthFromCache):
618
619 2015-11-30  Brady Eidson  <beidson@apple.com>
620
621         Modern IDB: After versionchange transactions abort, fire onerror on the original IDBOpenDBRequest.
622         https://bugs.webkit.org/show_bug.cgi?id=151648
623
624         Reviewed by Andy Estes.
625
626         No new tests. Covered by at least one existing failing test which now passes, and many
627         other tests updated to fix their incorrect behavior.
628
629         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
630         (WebCore::IDBClient::IDBDatabase::transaction):
631         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
632         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
633         
634         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
635         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
636         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
637         
638         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
639         (WebCore::IDBClient::IDBTransaction::notifyDidAbort):
640         (WebCore::IDBClient::IDBTransaction::didAbort):
641         (WebCore::IDBClient::IDBTransaction::didCommit):
642         * Modules/indexeddb/client/IDBTransactionImpl.h:
643
644 2015-11-30  Chris Dumez  <cdumez@apple.com>
645
646         location.origin is undefined in a web worker
647         https://bugs.webkit.org/show_bug.cgi?id=151614
648
649         Reviewed by Darin Adler.
650
651         Expose location.origin to web workers, as per:
652         https://html.spec.whatwg.org/multipage/workers.html#workerlocation
653
654         This behavior is consistent with the behavior of Firefox and Chrome.
655
656         Test: fast/workers/worker-location.html
657
658         * workers/WorkerLocation.cpp:
659         (WebCore::WorkerLocation::origin):
660         * workers/WorkerLocation.h:
661         * workers/WorkerLocation.idl:
662
663 2015-11-30  Brady Eidson  <beidson@apple.com>
664
665         Modern IDB: Support updating cursor values when the object store uses inline keys.
666         https://bugs.webkit.org/show_bug.cgi?id=151647
667
668         Reviewed by Andy Estes.
669
670         No new tests (At least two previously failing tests now pass and are unskipped).
671
672         * Modules/indexeddb/client/IDBCursorImpl.cpp:
673         (WebCore::IDBClient::IDBCursor::update): Use putForCursorUpdate() instead of put()
674         
675         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
676         (WebCore::IDBClient::IDBObjectStore::add):
677         (WebCore::IDBClient::IDBObjectStore::put):
678         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the flag to skip the inline-key check.
679         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add a flag to skip the inline-key check.
680         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
681
682 2015-11-30  Brady Eidson  <beidson@apple.com>
683
684         Modern IDB: Resolve flaky GC-vs-wrapper issue with IDBOpenDBRequest.
685         https://bugs.webkit.org/show_bug.cgi?id=151645
686
687         Reviewed by Andy Estes.
688
689         No new tests (Resolves flakiness with hundreds of existing IDB tests).
690
691         Do to improper management of the m_hasPendingActivity flag on IDBRequestImpl,
692         the request wrapper for an IDBOpenDBRequest might be garbage collected in between the
693         onUpgradeNeeded event and onSuccess event.
694         
695         This manifested as flakiness in many tests, some more than others.
696         
697         I tried to write a targeted 100% reproducible case manually forcing GC, but could not get
698         the timing right.
699         
700         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
701         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
702         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
703         
704         * Modules/indexeddb/client/IDBRequestImpl.cpp:
705         (WebCore::IDBClient::IDBRequest::dispatchEvent):
706         (WebCore::IDBClient::IDBRequest::willIterateCursor):
707         * Modules/indexeddb/client/IDBRequestImpl.h:
708         (WebCore::IDBClient::IDBRequest::isOpenDBRequest):
709
710 2015-11-30  Per Arne Vollan  <peavo@outlook.com>
711
712         [WinCairo][MediaFoundation] Implement seek.
713         https://bugs.webkit.org/show_bug.cgi?id=151609
714
715         Reviewed by Alex Christensen.
716
717         The methods maxTimeSeekable() and buffered() needs to be implemented.
718
719         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
720         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
721         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
722         (WebCore::MediaPlayerPrivateMediaFoundation::readyState):
723         (WebCore::MediaPlayerPrivateMediaFoundation::maxTimeSeekable):
724         (WebCore::MediaPlayerPrivateMediaFoundation::buffered):
725         (WebCore::MediaPlayerPrivateMediaFoundation::didLoadingProgress):
726         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
727         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
728         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
729         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::maxTimeLoaded):
730
731 2015-11-30  Brady Eidson  <beidson@apple.com>
732
733         Modern IDB: openCursor() fix resulting in at least 4 more passing tests.
734         https://bugs.webkit.org/show_bug.cgi?id=151630
735
736         Reviewed by Andy Estes.
737
738         No new tests (At least 4 failing tests now pass, and 9 other incorrect tests updated).
739
740         * Modules/indexeddb/IDBGetResult.cpp:
741         (WebCore::IDBGetResult::isolatedCopy):
742         * Modules/indexeddb/IDBGetResult.h:
743         (WebCore::IDBGetResult::IDBGetResult):
744         (WebCore::IDBGetResult::isDefined):
745
746         * Modules/indexeddb/client/IDBRequestImpl.cpp:
747         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): If the IDBGetResult is undefined,
748           do not expose the cursor as the result property of the IDBRequest.
749
750 2015-11-30  Brady Eidson  <beidson@apple.com>
751
752         Modern IDB: Support keyPath injection into object store records.
753         https://bugs.webkit.org/show_bug.cgi?id=151640
754
755         Reviewed by Andy Estes.
756
757         No new tests (At least one existing failure now passes and is unskipped,
758         while many other existing failures are now closer to passing).
759
760         * Modules/indexeddb/server/MemoryObjectStore.cpp:
761         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Use the new UniqueIDBDatabase VM/ExecState.
762         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto
763         (WebCore::IDBServer::indexVM): Deleted.
764         (WebCore::IDBServer::indexGlobalExec): Deleted.
765         
766         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
767         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
768         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
769         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): If appropriate, inject the key that will be used into
770           the value before storing the record.
771         * Modules/indexeddb/server/UniqueIDBDatabase.h:
772
773         Add modern JSValue/ExecState& version of some binding utilities, for use today and in preparation of getting 
774         rid of the DOMRequestState and Deprecated::ScriptValue versions later:
775         * bindings/js/IDBBindingUtilities.cpp:
776         (WebCore::idbKeyToJSValue):
777         (WebCore::injectIDBKeyIntoScriptValue):
778         (WebCore::deserializeIDBValueData):
779         (WebCore::deserializeIDBValueDataToJSValue):
780         * bindings/js/IDBBindingUtilities.h:
781
782 2015-11-25  Andy Estes  <aestes@apple.com>
783
784         [Content Filtering] Avoid creating a ContentFilter when loading the empty document
785         https://bugs.webkit.org/show_bug.cgi?id=151615
786
787         Reviewed by Daniel Bates.
788
789         It's expensive to create the first ContentFilter since two frameworks must be soft-linked. There's no reason to
790         pay this cost if we're just loading the empty document.
791
792         No new tests. It's not possible to write a test that would fail without this change since ContentFilter is not
793         notified of empty document loads.
794
795         * loader/DocumentLoader.cpp:
796         (WebCore::DocumentLoader::startLoadingMainResource): Don't initialize m_contentFilter until we know we aren't
797         loading the empty document.
798         (WebCore::DocumentLoader::DocumentLoader):
799
800 2015-11-29  Antoine Quint  <graouts@apple.com>
801
802         Browser does not fall back to SVG attribute value when CSS style value is invalid or not supported
803         https://bugs.webkit.org/show_bug.cgi?id=147932
804
805         Reviewed by Dean Jackson.
806
807         Instead of returning an SVGPaint object of type SVG_PAINTTYPE_UNKNOWN when we encounter an SVG paint
808         value that cannot be parsed, we now return `nullptr` which will cause that value to be ignored and
809         let another paint value in the cascade be used instead. This is the same approach used for SVGColor.
810         Since we're removing the only call site for `SVGPaint::createUnknown()`, we remove that function entirely.
811
812         Tests: svg/css/invalid-color-cascade.svg
813                svg/css/invalid-paint-cascade.svg
814
815         * css/SVGCSSParser.cpp:
816         (WebCore::CSSParser::parseSVGPaint):
817         * svg/SVGPaint.h:
818         (WebCore::SVGPaint::createUnknown): Deleted.
819
820 2015-11-29  Simon Fraser  <simon.fraser@apple.com>
821
822         Use SVGTransform::SVGTransformType instead of an unsigned short
823         https://bugs.webkit.org/show_bug.cgi?id=151637
824
825         Reviewed by Brady Eidson.
826
827         Make 'type' more strongly typed.
828
829         * svg/SVGTransformable.cpp:
830         (WebCore::SVGTransformable::parseTransformValue):
831         (WebCore::parseAndSkipType):
832         (WebCore::SVGTransformable::parseTransformType):
833         (WebCore::SVGTransformable::parseTransformAttribute):
834         * svg/SVGTransformable.h:
835
836 2015-11-27  Brady Eidson  <beidson@apple.com>
837
838         Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
839         https://bugs.webkit.org/show_bug.cgi?id=151627
840
841         Reviewed by Alexey Proskuryakov.
842
843         No new tests (No change in behavior).
844
845         * CMakeLists.txt:
846         * WebCore.xcodeproj/project.pbxproj:
847
848         * Modules/indexeddb/IDBGetResult.cpp: Added.
849         (WebCore::IDBGetResult::dataFromBuffer):
850         (WebCore::IDBGetResult::isolatedCopy):
851         * Modules/indexeddb/IDBGetResult.h:
852         (WebCore::IDBGetResult::IDBGetResult):
853         (WebCore::IDBGetResult::valueBuffer):
854         (WebCore::IDBGetResult::keyData):
855         (WebCore::IDBGetResult::primaryKeyData):
856         (WebCore::IDBGetResult::keyPath):
857         (WebCore::IDBGetResult::setValueBuffer):
858         (WebCore::IDBGetResult::setKeyData):
859         (WebCore::IDBGetResult::setPrimaryKeyData):
860         (WebCore::IDBGetResult::setKeyPath):
861         (WebCore::IDBGetResult::dataFromBuffer): Deleted.
862         (WebCore::IDBGetResult::isolatedCopy): Deleted.
863
864         * Modules/indexeddb/client/IDBCursorImpl.cpp:
865         (WebCore::IDBClient::IDBCursor::setGetResult):
866         * Modules/indexeddb/client/IDBCursorImpl.h:
867
868         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
869         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
870
871         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
872         (WebCore::GetOperation::perform):
873
874         * Modules/indexeddb/server/IDBBackingStore.h:
875
876         * Modules/indexeddb/server/MemoryCursor.h:
877
878         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
879         (WebCore::IDBServer::MemoryIndexCursor::currentData):
880
881         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
882         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
883
884         * platform/CrossThreadCopier.h:
885
886 2015-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
887
888         [GTK] Do not use the WebCore garbage collector timer
889         https://bugs.webkit.org/show_bug.cgi?id=151623
890
891         Reviewed by Martin Robinson.
892
893         Now that garbage collector timers have been implemented in
894         JavaScriptCore for glib, we don't need to use another Timer in WebCore.
895
896         * bindings/js/GCController.cpp:
897         (WebCore::GCController::garbageCollectSoon):
898         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
899
900 2015-11-18  Andy Estes  <aestes@apple.com>
901
902         [Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media document to load
903         https://bugs.webkit.org/show_bug.cgi?id=151433
904         rdar://problem/23506594
905
906         Reviewed by Alexey Proskuryakov.
907
908         When the main resource of a media document commits, WebKit cancels its load since the plug-in or media engine
909         will do its own loading. If content filtering is enabled, and the filter waits allow the load until the entire
910         resource is downloaded, then ContentFilter will attempt to call DocumentLoader::notifyFinished() immediately
911         after delivering the buffered resource data to DocumentLoader. However, delivering the data will have nulled out
912         DocumentLoader's m_mainResource when the load was cancelled, leading to a crash in notifyFinished().
913
914         To resolve this, add a new Stopped state to ContentFilter. Set this state if DocumentLoader clears its main
915         resource or detaches from its frame. If ContentFilter is in the Stopped state after calling
916         DocumentLoader::dataReceived(), do not proceed to call DocumentLoader::notifyFinished().
917
918         Test: contentfiltering/allow-media-document.html
919
920         * loader/ContentFilter.cpp:
921         (WebCore::ContentFilter::stopFilteringMainResource): Set m_state to Stopped. If m_mainResource is non-null,
922         removed ContentFilter as a client and set m_mainResource to null.
923         (WebCore::ContentFilter::notifyFinished): Stopped calling DocumentLoader::notifyFinished() if m_state is Stopped
924         after calling DocumentLoader::dataReceived().
925         * loader/ContentFilter.h:
926         * loader/DocumentLoader.cpp:
927         (WebCore::DocumentLoader::detachFromFrame): Called ContentFilter::stopFilteringMainResource() instead of setting
928         m_contentFilter to null.
929         (WebCore::DocumentLoader::clearMainResource): Ditto.
930
931 2015-11-25  Pranjal Jumde  <pjumde@apple.com>
932
933         Checks for buffer-overflows when reading characters from textRun
934         https://bugs.webkit.org/show_bug.cgi?id=151055
935         <rdar://problem/23251789>
936
937         Reviewed by Myles C. Maxfield.
938
939         Prevents an off by one error when adding the last font data to the GlyphBuffer.
940
941         * Source/WebCore/platform/graphics/WidthIterator.cpp:
942         * Source/WebCore/platform/graphics/FontCascade.cpp:
943
944 2015-11-24  Xabier Rodriguez Calvar  <calvaris@igalia.com>
945
946         [Streams API] Implement pipeTo method in readable Stream
947         https://bugs.webkit.org/show_bug.cgi?id=151588
948
949         Reviewed by Darin Adler.
950
951         Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
952         yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.
953
954         Tests: streams/pipe-to.html
955                streams/reference-implementation/brand-checks.html
956                streams/reference-implementation/pipe-through.html
957                streams/reference-implementation/pipe-to.html
958                streams/reference-implementation/pipe-to-options.html
959                streams/reference-implementation/readable-stream-templated
960
961         * Modules/streams/ReadableStream.js:
962         (doPipe): Internal function of pipeTo.
963         (closeDest): Internal function of pipeTo.
964         (abortDest): Internal function of pipeTo.
965         (pipeTo): Implemented as per spec with some other internal functions as helpers.
966
967 2015-11-24  Antti Koivisto  <antti@apple.com>
968
969         REGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
970         https://bugs.webkit.org/show_bug.cgi?id=151566
971         rdar://problem/23430177
972
973         Reviewed by Zalan Bujtas.
974
975         We don't invalidate slot assignments except for text or element children. Fix by not
976         not assigning other nodes to slots as it is not useful.
977
978         Test: fast/html/details-comment-crash.html
979
980         * dom/SlotAssignment.cpp:
981         (WebCore::slotNameFromSlotAttribute):
982         (WebCore::SlotAssignment::findAssignedSlot):
983         (WebCore::SlotAssignment::assignSlots):
984
985 2015-11-23  David Kilzer  <ddkilzer@apple.com>
986
987         Hardening against CSSSelector double frees
988         <http://webkit.org/b/56124>
989         <rdar://problem/9119036>
990
991         Reviewed by Antti Koivisto.
992
993         Add some security assertions to catch this issue if it ever
994         happens in Debug builds, and make changes in
995         CSSSelector::~CSSSelector() and
996         CSSSelectorList::deleteSelectors() to prevent obvious issues if
997         they're ever called twice in Release builds.
998
999         No new tests because we don't know how to reproduce this.
1000
1001         * css/CSSSelector.cpp:
1002         (WebCore::CSSSelector::CSSSelector): Initialize
1003         m_destructorHasBeenCalled.
1004         * css/CSSSelector.h:
1005         (WebCore::CSSSelector::m_destructorHasBeenCalled): Add bitfield.
1006         (WebCore::CSSSelector::CSSSelector): Initialize
1007         m_destructorHasBeenCalled.
1008         (WebCore::CSSSelector::~CSSSelector): Add security assertion
1009         that this is never called twice.  Clear out any fields that
1010         would have caused us to dereference an object twice.
1011
1012         * css/CSSSelectorList.cpp:
1013         (WebCore::CSSSelectorList::deleteSelectors): Clear
1014         m_selectorArray when freeing the memory to which it was
1015         pointing.  This prevents re-entrancy issues or calling this
1016         method twice on the same thread.  Also restructure the for()
1017         loop to prevent calling CSSSelector::isLastInSelectorList()
1018         after CSSSelector::~CSSSelector() has been called (via CRBug
1019         241892).
1020
1021 2015-11-23  Brian Burg  <bburg@apple.com>
1022
1023         Web Inspector: inspector settings should not be shared between different inspection levels
1024         https://bugs.webkit.org/show_bug.cgi?id=151151
1025
1026         Reviewed by Timothy Hatcher.
1027
1028         InspectorController and InspectorFrontendClient should know how to compute their
1029         inspection levels, so that this level can be exposed to the Inspector frontend for
1030         preference disambiguation by inspection level.
1031
1032          - A Page with normal web content has an inspection level of 0.
1033          - The first Web Inspector has an inspection level of 1.
1034          - The second Web Inspector that inspects the Inspector has an inspection level of 2.
1035          - And so forth...
1036
1037         For local frontend clients (WK1 and the ProtocolTestStub), the inspection level of
1038         a Page computed as follows:
1039
1040         - If the page's inspector controller has no frontend client, then the Page
1041         is normal web content (level 0).
1042         - If the page's inspector controller has a frontend client, ask for its inspection level.
1043         A frontend client looks at the inspection level reported by inspected page's inspector
1044         controller and increments by one to account for the crossed inspection boundary.
1045
1046         No new tests, this is blocked by test infrastructure fixes (https://webkit.org/b/151573).
1047
1048         * inspector/InspectorController.cpp:
1049         (WebCore::InspectorController::inspectionLevel): Added.
1050         (WebCore::InspectorController::hasInspectorFrontendClient): Deleted.
1051         * inspector/InspectorController.h:
1052         * inspector/InspectorFrontendClient.h:
1053         * inspector/InspectorFrontendClientLocal.cpp:
1054         (WebCore::InspectorFrontendClientLocal::canAttachWindow): Check inspectionLevel().
1055         (WebCore::InspectorFrontendClientLocal::inspectionLevel): Added.
1056         * inspector/InspectorFrontendClientLocal.h:
1057         * inspector/InspectorFrontendHost.cpp:
1058         (WebCore::InspectorFrontendHost::inspectionLevel): Added.
1059         * inspector/InspectorFrontendHost.h:
1060         * inspector/InspectorFrontendHost.idl:
1061         * page/ContextMenuController.cpp:
1062         (WebCore::ContextMenuController::populate): Check inspectionLevel().
1063
1064 2015-11-20  Brian Burg  <bburg@apple.com>
1065
1066         Web Inspector: RemoteInspector should track targets and connections for remote automation
1067         https://bugs.webkit.org/show_bug.cgi?id=151042
1068
1069         Reviewed by Joseph Pecoraro.
1070
1071         Use the new RemoteControllableTarget API method names.
1072
1073         No new tests, no behavior change.
1074
1075         * page/PageDebuggable.cpp:
1076         (WebCore::PageDebuggable::connect):
1077         (WebCore::PageDebuggable::dispatchMessageFromRemote):
1078         (WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
1079         * page/PageDebuggable.h:
1080
1081 2015-11-23  Brady Eidson  <beidson@apple.com>
1082
1083         Modern IDB: Unskip all indexeddb/mozilla tests that pass.
1084         https://bugs.webkit.org/show_bug.cgi?id=151568
1085         
1086         Reviewed by Alex Christensen.
1087
1088         No new tests (Lots of skipped existing tests now pass).
1089
1090         * Modules/indexeddb/shared/IDBError.h:
1091
1092 2015-11-23  Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
1093
1094         Add WebCore namespace for generated bindings for supplemental method calls
1095         https://bugs.webkit.org/show_bug.cgi?id=151431
1096
1097         Reviewed by Alex Christensen.
1098
1099         Address build failures for generated supplemental method calls which are in the WebCore namespace. 
1100         The bindings are outside the WebCore namespace - so add WebCore namespace specifier where required.
1101
1102         * bindings/scripts/CodeGeneratorJS.pm:
1103         (GenerateHeader):
1104         (GenerateImplementation):
1105         (GenerateParametersCheck):
1106         * bindings/scripts/CodeGeneratorObjC.pm:
1107         (GenerateImplementation):
1108         * bindings/scripts/test/JS/JSTestInterface.cpp:
1109         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
1110         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
1111         (WebCore::jsTestInterfaceSupplementalStr1):
1112         (WebCore::jsTestInterfaceSupplementalStr2):
1113         (WebCore::jsTestInterfaceSupplementalNode):
1114         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1115         (WebCore::setJSTestInterfaceSupplementalStr2):
1116         (WebCore::setJSTestInterfaceSupplementalNode):
1117         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
1118         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1119         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
1120         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
1121         (-[DOMTestInterface supplementalStr1]):
1122         (-[DOMTestInterface supplementalStr2]):
1123         (-[DOMTestInterface setSupplementalStr2:]):
1124         (-[DOMTestInterface supplementalStr3]):
1125         (-[DOMTestInterface setSupplementalStr3:]):
1126         (-[DOMTestInterface supplementalNode]):
1127         (-[DOMTestInterface setSupplementalNode:]):
1128         (-[DOMTestInterface builtinAttribute]):
1129         (-[DOMTestInterface setBuiltinAttribute:]):
1130         (-[DOMTestInterface supplementalMethod1]):
1131         (-[DOMTestInterface supplementalMethod2:objArg:]):
1132         (-[DOMTestInterface supplementalMethod3]):
1133         (-[DOMTestInterface supplementalMethod4]):
1134         (-[DOMTestInterface builtinFunction]):
1135
1136 2015-11-23  Brady Eidson  <beidson@apple.com>
1137
1138         Modern IDB: When a transaction is aborted, call onerror handlers for all in-progress requests.
1139         https://bugs.webkit.org/show_bug.cgi?id=151550
1140
1141         Reviewed by Alex Christensen.
1142
1143         Test: storage/indexeddb/modern/abort-requests-cancelled.html
1144               storage/indexeddb/modern/idbtransaction-objectstore-failures.html (with changes)
1145               storage/indexeddb/modern/index-5.html (with changes)
1146               Various (currently skipped) legacy IDB tests.
1147
1148         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1149         (WebCore::IDBClient::IDBDatabase::transaction):
1150         (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
1151         (WebCore::IDBClient::IDBDatabase::didStartTransaction):
1152         (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
1153         (WebCore::IDBClient::IDBDatabase::didCommitTransaction):
1154         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
1155         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
1156         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
1157         
1158         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1159         (WebCore::IDBClient::IDBTransaction::abort):
1160         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
1161         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
1162         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
1163         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1164         (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
1165         (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
1166         (WebCore::IDBClient::IDBTransaction::immediateAbort): Deleted.
1167         (WebCore::IDBClient::IDBTransaction::abortOnServer): Deleted.
1168         * Modules/indexeddb/client/IDBTransactionImpl.h:
1169         
1170         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1171         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
1172         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
1173         
1174         * Modules/indexeddb/shared/IDBError.cpp:
1175         (WebCore::idbErrorName):
1176         (WebCore::idbErrorDescription):
1177         * Modules/indexeddb/shared/IDBError.h:
1178         
1179         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1180         (WebCore::IDBResourceIdentifier::loggingString):
1181         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1182
1183 2015-11-23  Brady Eidson  <beidson@apple.com>
1184
1185         Modern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
1186         https://bugs.webkit.org/show_bug.cgi?id=151557
1187
1188         Reviewed by Alex Christensen.
1189
1190         No new tests (Unskipping existing test storage/indexeddb/mozilla/global-data.html).
1191
1192         - Reworking some invalid ASSERTS
1193         - Actually opening pending open-database-requests after a version change transaction completes
1194         - Allow starting new transactions when the version change transaction has *started* finishing, 
1195           but before it finishes finishing.
1196
1197         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1198         (WebCore::IDBClient::IDBDatabase::transaction):
1199         
1200         * Modules/indexeddb/client/IDBTransactionImpl.h:
1201         
1202         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1203         (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
1204         
1205         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1206         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): Deleted.
1207         
1208         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1209         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1210         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
1211         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1212         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1213
1214 2015-11-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1215
1216         Remove DOMPromiseWithCallback
1217         https://bugs.webkit.org/show_bug.cgi?id=151565
1218
1219         Reviewed by Eric Carlson.
1220
1221         DOMPromiseWithCallback is no longer used as WebCore JS built-ins are used to the cases where DOMPromiseWithCallback made sense.
1222
1223         No change in behavior.
1224
1225         * Modules/mediastream/MediaDevices.h: Moved from DOMPromiseWithCallback to DOMPromise since the API is now called by JS built-ins.
1226         * bindings/js/JSDOMPromise.h:
1227         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback): Deleted.
1228         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback): Deleted.
1229         (WebCore::Error>::resolve): Deleted.
1230         (WebCore::Error>::reject): Deleted.
1231         (WebCore::Error>::resolveEnd): Deleted.
1232
1233 2015-11-23  Brian Burg  <bburg@apple.com>
1234
1235         Web Inspector: when inspecting the inspector, add the inspection level to the title bar
1236         https://bugs.webkit.org/show_bug.cgi?id=151555
1237
1238         Reviewed by Timothy Hatcher.
1239
1240         * English.lproj/Localizable.strings: add new localized string for alternate inspector title.
1241
1242 2015-11-23  Zan Dobersek  <zdobersek@igalia.com>
1243
1244         [GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStreamerBase dtor
1245         https://bugs.webkit.org/show_bug.cgi?id=151558
1246
1247         Reviewed by Carlos Garcia Campos.
1248
1249         In the MediaPlayerPrivateGStreamerBase destructor, there's some leftover code
1250         that acquires a reference to the GStreamer pipeline's bus object and then
1251         just asserts that it's not null. Not very useful, so remove it.
1252
1253         Also use nullptr to null out the m_player member.
1254
1255         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1256         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1257
1258 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
1259
1260         ASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
1261         https://bugs.webkit.org/show_bug.cgi?id=151254
1262
1263         Reviewed by Darin Adler.
1264
1265         When in quirks mode, abnormally huge margins could lead to
1266         negative computations of available logical sizes. We could add
1267         an !document.inQuirksMode() check in the assertion but since
1268         negative freeSpace values are valid (i.e. the condition is not
1269         really part of the contract and everything will work as
1270         expected) I've decided to simply remove it.
1271
1272         Test: fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html
1273
1274         * rendering/RenderGrid.cpp:
1275         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
1276
1277 2015-11-22  Myles C. Maxfield  <mmaxfield@apple.com>
1278
1279         Font selection should not consult font-variant property
1280         https://bugs.webkit.org/show_bug.cgi?id=151537
1281
1282         Reviewed by Simon Fraser.
1283
1284         In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
1285         font-feature-settings] do not affect font selection."
1286
1287         All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
1288         are the only one who misbehaves. This patch aligns our behavior with the other
1289         browsers.
1290
1291         Test: fast/text/font-selection-font-variant.html
1292
1293         * css/CSSFontSelector.cpp:
1294         (WebCore::computeTraitsMask): Deleted.
1295         (WebCore::compareFontFaces): Deleted.
1296         (WebCore::CSSFontSelector::getFontFace): Deleted.
1297         * css/CSSParser.cpp:
1298         (WebCore::isValidKeywordPropertyAndValue):
1299         (WebCore::isKeywordPropertyID):
1300         (WebCore::CSSParser::createFontFaceRule):
1301         (WebCore::CSSParser::CSSParser): Deleted.
1302         (WebCore::CSSParser::parseValue): Deleted.
1303         (WebCore::CSSParser::parseDeclaration): Deleted.
1304         (WebCore::CSSParser::clearProperties): Deleted.
1305         (WebCore::CSSParser::parseFontVariant): Deleted.
1306         (WebCore::CSSParser::createStyleRule): Deleted.
1307         (WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
1308         * css/CSSParser.h:
1309         * platform/graphics/FontDescription.cpp:
1310         (WebCore::FontDescription::traitsMask): Deleted.
1311         * platform/graphics/win/FontCacheWin.cpp:
1312         (WebCore::traitsInFamilyEnumProc):
1313         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1314         (WebCore::toTraitsMask):
1315         * platform/text/TextFlags.h:
1316
1317 2015-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1318
1319         Unreviewed, rolling out r192727.
1320
1321         It made the selections transparent again and broke
1322         /webkit2/WebKitWebView/snapshot
1323
1324         Reverted changeset:
1325
1326         "[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor,
1327         et. al. should not clobber state of cached GtkStyleContexts"
1328         https://bugs.webkit.org/show_bug.cgi?id=151533
1329         http://trac.webkit.org/changeset/192727
1330
1331 2015-11-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1332
1333         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
1334         https://bugs.webkit.org/show_bug.cgi?id=151533
1335
1336         Reviewed by Carlos Garcia Campos.
1337
1338         platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc.
1339         are const functions intended only to return a color used for painting, but since r174929
1340         they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and
1341         GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This
1342         could cause theme colors returned by those GtkStyleContexts to change unexpectedly,
1343         depending on whether the state is explicitly set before each use, or whether the theme
1344         actually uses the states.
1345
1346         This didn't cause any regression only because every place using these style contexts
1347         explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style
1348         context is not used anywhere else, and the GtkEntry style context is only used in
1349         paintTextField, which does set the state before use (and then reverts it using
1350         save/restore), so this cannot have broken anything in practice. But it's a landmine waiting
1351         for the next programmer to trip it.
1352
1353         Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair.
1354
1355         * rendering/RenderThemeGtk.cpp:
1356         (WebCore::styleColor):
1357
1358 2015-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
1359
1360         Tiny cleanup in ComplexTextController::collectComplexTextRuns()
1361         https://bugs.webkit.org/show_bug.cgi?id=151534
1362
1363         Reviewed by Zalan Bujtas.
1364
1365         The isMissingGlyph boolean is completely unnecessary. Its entire
1366         responsiblity is duplicated by the "font" pointer.
1367
1368         No new tests because there is no behavior change.
1369
1370         * platform/graphics/mac/ComplexTextController.cpp:
1371         (WebCore::ComplexTextController::collectComplexTextRuns):
1372
1373 == Rolled over to ChangeLog-2015-11-21 ==