bd7484f2aad1c8c25c37f8596b84f08de27e9f17
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-11  Eric Carlson  <eric.carlson@apple.com>
2
3         [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
4         https://bugs.webkit.org/show_bug.cgi?id=152197
5
6         Reviewed by Dean Jackson.
7
8         Test: fast/mediastream/mock-media-source.html
9
10         * page/Settings.cpp:
11         (WebCore::Settings::mockCaptureDevicesEnabled):
12         (WebCore::Settings::setMockCaptureDevicesEnabled):
13         * page/Settings.h:
14
15         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
16         (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenterOverride): Renamed.
17         (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenter): Deleted.
18         * platform/mediastream/RealtimeMediaSourceCenter.h:
19
20         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
21         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): Renamed. Allow
22           it to be enabled and disabled.
23         (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter): Deleted.
24         * platform/mock/MockRealtimeMediaSourceCenter.h:
25
26         * testing/Internals.cpp:
27         (WebCore::Internals::Internals):
28         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
29         * testing/Internals.h:
30         * testing/Internals.idl:
31
32 2015-12-11  Jer Noble  <jer.noble@apple.com>
33
34         [EME] Do not pass in the initialization data to AVContentKeyRequest as the contentIdentifier.
35         https://bugs.webkit.org/show_bug.cgi?id=152204
36         rdar://problem/23867877
37
38         Reviewed by Eric Carlson.
39
40         The AVContentKeyRequest API has been updated to no longer require a contentId parameter if the
41         ID can be derived from the initialization data.
42
43         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
44         (WebCore::CDMSessionAVContentKeySession::update):
45
46 2015-12-11  Alexey Proskuryakov  <ap@apple.com>
47
48         Roll out http://trac.webkit.org/r193984, because the new test is timing out.
49
50         Was: Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
51         https://bugs.webkit.org/show_bug.cgi?id=152102
52         <rdar://problem/22124230>
53
54         * dom/Document.cpp:
55         (WebCore::Document::processReferrerPolicy):
56         (WebCore::Document::applyContentDispositionAttachmentSandbox):
57
58 2015-12-11  Brady Eidson  <beidson@apple.com>
59
60         Modern IDB: storage/indexeddb/optional-arguments.html fails.
61         https://bugs.webkit.org/show_bug.cgi?id=152194
62
63         Reviewed by Alex Christensen.
64
65         No new tests (At least one failing test now passes).
66
67         * Modules/indexeddb/client/IDBCursorImpl.cpp:
68         (WebCore::IDBClient::IDBCursor::continueFunction): Allow 'undefined' for the key.
69         
70         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
71         (WebCore::IDBClient::IDBObjectStore::add): Ditto.
72         (WebCore::IDBClient::IDBObjectStore::put): Ditto.
73
74 2015-12-11  Brady Eidson  <beidson@apple.com>
75
76         Followup to:
77         Modern IDB: storage/indexeddb/index-count.html fails.
78         https://bugs.webkit.org/show_bug.cgi?id=152175
79
80         Noticed by Darin Adler.
81
82         * Modules/indexeddb/client/IDBIndexImpl.cpp:
83         (WebCore::IDBClient::IDBIndex::count): Replace a curly brace to its proper place.
84
85 2015-12-11  Brady Eidson  <beidson@apple.com>
86
87         Modern IDB: storage/indexeddb/cursor-continue.html fails.
88         https://bugs.webkit.org/show_bug.cgi?id=152192
89
90         Reviewed by Alex Christensen.
91
92         No new tests (At least one failing test now passes).
93
94         * Modules/indexeddb/client/IDBCursorImpl.cpp:
95         (WebCore::IDBClient::IDBCursor::continueFunction): Check against the current key, not the current primary key.
96         (WebCore::IDBClient::IDBCursor::setGetResult): Also save off the current IDBKeyData.
97         * Modules/indexeddb/client/IDBCursorImpl.h:
98
99 2015-12-11  Brady Eidson  <beidson@apple.com>
100
101         Modern IDB: storage/indexeddb/index-basics.html fails.
102         https://bugs.webkit.org/show_bug.cgi?id=152190
103
104         Reviewed by Alex Christensen.
105
106         No new tests (At least one failing test now passes).
107
108         * bindings/js/JSIDBObjectStoreCustom.cpp:
109         (WebCore::JSIDBObjectStore::createIndex): Custom error message for the TypeError
110
111 2015-12-11  Jiewen Tan  <jiewen_tan@apple.com>
112
113         Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
114         https://bugs.webkit.org/show_bug.cgi?id=152102
115         <rdar://problem/22124230>
116
117         Reviewed by Andy Estes.
118
119         Keep the ReferrerPolicy for a document as ReferrerPolicyNever if the document is loaded with
120         "Content-Disposition: attachment".
121
122         Test: http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html
123
124         * dom/Document.cpp:
125         (WebCore::Document::processReferrerPolicy):
126         (WebCore::Document::applyContentDispositionAttachmentSandbox):
127
128 2015-12-11  Brady Eidson  <beidson@apple.com>
129
130         Modern IDB: storage/indexeddb/key-type-array.html fails.
131         https://bugs.webkit.org/show_bug.cgi?id=152187
132
133         Reviewed by Alex Christensen.
134
135         No new tests (At least one failing test now passes).
136
137         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
138         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Perform the correct validity check on array keys.
139
140 2015-12-11  Joseph Pecoraro  <pecoraro@apple.com>
141
142         check-for-inappropriate-objc-class-names should check all class names, not just externally visible ones
143         https://bugs.webkit.org/show_bug.cgi?id=152156
144
145         Reviewed by Dan Bernstein.
146
147         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
148         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
149         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
150         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
151         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
152         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
153         Rename classes with a "Web" prefix.
154
155 2015-12-11  Brady Eidson  <beidson@apple.com>
156
157         Modern IDB: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html fails.
158         https://bugs.webkit.org/show_bug.cgi?id=152177
159
160         Reviewed by Alex Christensen.
161
162         No new tests (At least one failing test now passes).
163
164         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
165         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionDidFinish): Renamed from below.
166         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Deleted.
167         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
168         
169         * Modules/indexeddb/client/IDBRequestImpl.cpp:
170         (WebCore::IDBClient::IDBRequest::setVersionChangeTransaction): OpenDBRequests usually don't have transactions, 
171           unless they end up being upgrade requests.
172         * Modules/indexeddb/client/IDBRequestImpl.h:
173         
174         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
175         (WebCore::IDBClient::IDBTransaction::IDBTransaction): Call setVersionChangeTransaction on the request if appropriate.
176         (WebCore::IDBClient::IDBTransaction::dispatchEvent): Call versionChangeTransactionDidFinish after the 
177           abort/complete events fire.
178         (WebCore::IDBClient::IDBTransaction::abort): Deleted.
179         (WebCore::IDBClient::IDBTransaction::commit): Deleted.
180
181 2015-12-11  Brady Eidson  <beidson@apple.com>
182
183         Modern IDB: storage/indexeddb/index-count.html fails.
184         https://bugs.webkit.org/show_bug.cgi?id=152175
185
186         Reviewed by Alex Christensen.
187
188         No new tests (At least one failing test now passes).
189
190         * Modules/indexeddb/client/IDBIndexImpl.cpp:
191         (WebCore::IDBClient::IDBIndex::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
192         (WebCore::IDBClient::IDBIndex::doCount): Change an isNull check to a more correct !isValid() check.
193
194 2015-12-11  Per Arne Vollan  <peavo@outlook.com>
195
196         [WinCairo][MediaFoundation] Setting playback rate does not work.
197         https://bugs.webkit.org/show_bug.cgi?id=152172
198
199         Reviewed by Brent Fulgham.
200
201         Implement method to set playback rate.
202
203         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
204         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
205         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble):
206         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
207         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
208
209 2015-12-11  Darin Adler  <darin@apple.com>
210
211         Reduce the number of events that can be created by Document.createEvent
212         https://bugs.webkit.org/show_bug.cgi?id=151931
213
214         Reviewed by Alex Christensen.
215
216         Document.createEvent is intended for use only with a certain set of legacy events.
217         Ideally it should only be the ones mentioned in the DOM specification.
218
219         For now, at least remove all the events that can't usefully be created and initialized
220         this way. Later, we should cut it down even smaller. And stop automatically generating
221         this, which was causing everyone who made an event IDL file to get supported here!
222
223         The modern alternative is to use event class constructors instead.
224
225         * CMakeLists.txt: Don't compile EventFactory.cpp. For now, we still generate
226         EventFactory.cpp but we do not use it.
227         * DerivedSources.make: Ditto.
228         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
229         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
230         * WebCore.xcodeproj/project.pbxproj: Ditto. Also don't include EventFactory.h in the
231         project file.
232
233         * dom/DOMImplementation.cpp:
234         (WebCore::DOMImplementation::hasFeature): Added a comment about the SVGZoomEvents feature.
235
236         * dom/Document.cpp: Re-sorted includes and added the new ones needed for createEvent.
237         (WebCore::Document::createEvent): Moved all the logic here from EventFactory, and
238         took a crack at comments that explain what this should and should not be used for.
239
240         * dom/EventFactory.h: Removed.
241
242 2015-12-10  Brady Eidson  <beidson@apple.com>
243
244         Modern IDB: storage/indexeddb/objectstore-count.html fails.
245         https://bugs.webkit.org/show_bug.cgi?id=152167
246
247         Reviewed by Alex Christensen.
248
249         No new tests (At least one failing test now passes).
250
251         * Modules/indexeddb/IDBKeyRangeData.h:
252         (WebCore::IDBKeyRangeData::allKeys):
253         
254         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
255         (WebCore::IDBClient::IDBObjectStore::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
256         (WebCore::IDBClient::IDBObjectStore::doCount): Change an isNull check to a more correct !isValid() check.
257
258 2015-12-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
259
260         Binding and builtin generators should lowercase RTCXX as rtcXX and not rTCXX
261         https://bugs.webkit.org/show_bug.cgi?id=152121
262
263         Reviewed by Darin Adler.
264
265         No change in behavior.
266
267         * bindings/js/JSDOMWindowBase.cpp:
268         (WebCore::JSDOMWindowBase::finishCreation): Using rtcXX in lieu of rTCXX.
269         * bindings/js/WebCoreJSBuiltinInternals.h:
270         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions): Ditto.
271         (WebCore::JSBuiltinInternalFunctions::rtcPeerConnectionInternals): Added.
272         (WebCore::JSBuiltinInternalFunctions::visit): Ditto.
273         (WebCore::JSBuiltinInternalFunctions::init): Ditto.
274         (WebCore::JSBuiltinInternalFunctions::rTCPeerConnectionInternals): Deleted.
275         * bindings/js/WebCoreJSBuiltins.h:
276         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions): Using rtcXX in lieu of rTCXX.
277         (WebCore::JSBuiltinFunctions::rtcPeerConnectionBuiltins): Added.
278         (WebCore::JSBuiltinFunctions::rtcPeerConnectionInternalsBuiltins): Added.
279         (WebCore::JSBuiltinFunctions::rTCPeerConnectionBuiltins): Deleted.
280         (WebCore::JSBuiltinFunctions::rTCPeerConnectionInternalsBuiltins): Deleted.
281         * bindings/scripts/CodeGenerator.pm:
282         (WK_lcfirst): Added RTC special rule.
283
284 2015-12-10  Zalan Bujtas  <zalan@apple.com>
285
286         ASSERTION FAILED: !simpleLineLayout() in WebCore::RenderText::collectSelectionRectsForLineBoxes
287         https://bugs.webkit.org/show_bug.cgi?id=152115
288
289         Reviewed by Simon Fraser.
290
291         document.execCommand("indent") generates a blockquote wrapper and moves the indented content inside.
292         If the indented content is already inside a selection, we need to make sure that newly created flow uses
293         normal line layout.
294         This patch fixes the generic case as re-parenting an already selected renderer is not specific to document.execCommand("indent").
295
296         Test: fast/block/selection-inside-simple-line-layout.html
297
298         * rendering/SimpleLineLayout.cpp:
299         (WebCore::SimpleLineLayout::canUseForWithReason):
300         (WebCore::SimpleLineLayout::printReason):
301
302 2015-12-10  Eric Carlson  <eric.carlson@apple.com>
303
304         [MediaStream] Expose media capture devices persistent permissions to WebCore
305         https://bugs.webkit.org/show_bug.cgi?id=152087
306
307         Reviewed by Chris Dumez.
308
309         No new tests, an existing test was updated to test the change.
310
311         * CMakeLists.txt: Add UserMediaPermissionCheck.cpp.
312
313         * Modules/mediastream/MediaDevicesRequest.cpp:
314         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the permission checker client.
315         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
316         (WebCore::MediaDevicesRequest::start): Create a permission checker and start it running.
317         (WebCore::MediaDevicesRequest::didCompleteCheck): Start the media source checker.
318         (WebCore::MediaDevicesRequest::didCompleteRequest): Only include a track's label if the
319           page has permission to use a capture device.
320         * Modules/mediastream/MediaDevicesRequest.h:
321
322         * Modules/mediastream/UserMediaClient.h: Include prototypes for permission checker.
323         (WebCore::UserMediaClient::~UserMediaClient):
324         
325         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp: Removed, not longer used.
326         * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
327
328         * Modules/mediastream/UserMediaController.h:
329         (WebCore::UserMediaController::checkUserMediaPermission): New.
330         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Ditto.
331
332         * Modules/mediastream/UserMediaPermissionCheck.cpp: Added.
333         (WebCore::UserMediaPermissionCheck::create):
334         (WebCore::UserMediaPermissionCheck::UserMediaPermissionCheck):
335         (WebCore::UserMediaPermissionCheck::~UserMediaPermissionCheck):
336         (WebCore::UserMediaPermissionCheck::securityOrigin):
337         (WebCore::UserMediaPermissionCheck::contextDestroyed):
338         (WebCore::UserMediaPermissionCheck::start):
339         (WebCore::UserMediaPermissionCheck::setDeviceAccessMode):
340         * Modules/mediastream/UserMediaPermissionCheck.h: Added.
341         (WebCore::UserMediaPermissionCheckClient::~UserMediaPermissionCheckClient):
342         (WebCore::UserMediaPermissionCheck::setClient):
343
344         * WebCore.xcodeproj/project.pbxproj: Add UserMediaPermissionCheck.cpp|.h
345
346         * platform/mock/UserMediaClientMock.h: Removed, it is no longer used.
347
348         * testing/Internals.cpp: Remove UserMediaClientMock.h include, it is gone.
349
350 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
351
352         Build fix
353
354         Unreviewed.
355
356         * platform/graphics/cocoa/FontCocoa.mm:
357         (WebCore::smallCapsTrueTypeDictionary):
358
359 2015-12-10  Simon Fraser  <simon.fraser@apple.com>
360
361         Mordernize viewport dumping
362         https://bugs.webkit.org/show_bug.cgi?id=152159
363
364         Reviewed by Zalan Bujtas.
365
366         Use groupings to simplify the viewport configuration dumping code.
367
368         * page/ViewportConfiguration.cpp:
369         (WebCore::operator<<):
370         (WebCore::ViewportConfiguration::description):
371
372 2015-12-10  Joseph Pecoraro  <pecoraro@apple.com>
373
374         Remote Inspector: Verify the identity of the other side of XPC connections
375         https://bugs.webkit.org/show_bug.cgi?id=152153
376
377         Reviewed by Brian Burg.
378
379         * WebCore.xcodeproj/project.pbxproj:
380         * platform/network/mac/CertificateInfoMac.mm:
381         Use the new header.
382
383 2015-12-10  Brady Eidson  <beidson@apple.com>
384
385         Modern IDB: storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange.html fails
386         https://bugs.webkit.org/show_bug.cgi?id=152144
387
388         Reviewed by Alex Christensen.
389
390         No new tests (At least two failing tests now pass, and other incorrect tests updated to be more correct).
391
392         - An IDBOpenDBRequest resulting in a versionchange transaction should not have the onsuccess event fire if 
393           the database connection was closed during the versionchange transaction. onerror should fire instead.
394         - When firing an event at an IDBRequest, it should not have the transaction as an additional target if the
395           transaction has finished.
396         - When firing an event at an IDBRequest, it should not have the database as an additional target if the
397           database is closed or is closing.
398
399         * Modules/indexeddb/client/IDBDatabaseImpl.h:
400         (WebCore::IDBClient::IDBDatabase::isClosingOrClosed):
401         
402         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
403         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
404         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort): Deleted.
405         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
406         
407         * Modules/indexeddb/client/IDBRequestImpl.cpp:
408         (WebCore::IDBClient::IDBRequest::dispatchEvent): Don't add finished transactions or closed databases as event targets.
409         
410         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
411         (WebCore::IDBClient::IDBTransaction::notifyDidAbort):
412         (WebCore::IDBClient::IDBTransaction::dispatchEvent): If this was a versionchange transaction completing, possibly fire
413           the error event on the OpenDBRequest instead of the success event.
414         * Modules/indexeddb/client/IDBTransactionImpl.h:
415         (WebCore::IDBClient::IDBTransaction::isFinished):
416
417 2015-12-10  Zalan Bujtas  <zalan@apple.com>
418
419         Simple line layout: Use TextPainter to draw simple line text.
420         https://bugs.webkit.org/show_bug.cgi?id=152150
421
422         Reviewed by Simon Fraser.
423
424         No change in functionality.
425
426         * rendering/SimpleLineLayoutFunctions.cpp:
427         (WebCore::SimpleLineLayout::paintFlow):
428         * rendering/TextPainter.h:
429
430 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
431
432         [Font Features] r193894 introduces leaks
433         https://bugs.webkit.org/show_bug.cgi?id=152154
434
435         Reviewed by Joe Pecoraro.
436
437         * platform/graphics/cocoa/FontCocoa.mm:
438         (WebCore::smallCapsTrueTypeDictionary):
439         (WebCore::createCTFontWithoutSynthesizableFeatures):
440
441 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
442
443         Build fix
444
445         Unreviewed.
446
447         * platform/graphics/cocoa/FontCocoa.mm:
448         (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
449
450 2015-12-10  Zalan Bujtas  <zalan@apple.com>
451
452         TextPainter: Add support for painting multiple text runs.
453         https://bugs.webkit.org/show_bug.cgi?id=152148
454
455         Reviewed by Simon Fraser.
456
457         This is in preparation for adding simple line layout as a client.
458
459         No change in functionality.
460
461         * rendering/InlineTextBox.cpp:
462         (WebCore::drawSkipInkUnderline): Decouple underline skipping intersection calculation and text painter.
463         (WebCore::InlineTextBox::paint):
464         (WebCore::InlineTextBox::paintDecoration):
465         * rendering/InlineTextBox.h:
466         * rendering/TextPainter.cpp:
467         (WebCore::TextPainter::TextPainter):
468         (WebCore::TextPainter::paintTextWithShadows):
469         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
470         (WebCore::TextPainter::paintText):
471         (WebCore::TextPainter::dashesForIntersectionsWithRect): Deleted.
472         * rendering/TextPainter.h:
473         (WebCore::TextPainter::setTextPaintStyle):
474         (WebCore::TextPainter::setSelectionPaintStyle):
475         (WebCore::TextPainter::setIsHorizontal):
476         (WebCore::TextPainter::setFont):
477         (WebCore::TextPainter::addEmphasis):
478         (WebCore::TextPainter::addTextShadow):
479
480 2015-12-10  Enrica Casucci  <enrica@apple.com>
481
482         Change skin tone support for two emoji.
483         https://bugs.webkit.org/show_bug.cgi?id=152147
484         rdar://problem/23716993
485         rdar://problem/23716344
486
487         Reviewed by Darin Adler.
488
489         Horse race emoji (1F3C7) should no longer have skin tone variation.
490         Sleuth/Spy emoji (!F575) should instead have skin tone variation.
491
492         * platform/text/TextBreakIterator.cpp:
493         (WebCore::cursorMovementIterator):
494
495 2015-12-10  Commit Queue  <commit-queue@webkit.org>
496
497         Unreviewed, rolling out r193500.
498         https://bugs.webkit.org/show_bug.cgi?id=152143
499
500         do not want to have to disable canvas-to-large-to-draw test
501         (Requested by bfulgham on #webkit).
502
503         Reverted changeset:
504
505         "Place an upper bound on canvas pixel count"
506         https://bugs.webkit.org/show_bug.cgi?id=151825
507         http://trac.webkit.org/changeset/193500
508
509 2015-12-10  Brady Eidson  <beidson@apple.com>
510
511         Followup for:
512         Modern IDB: storage/indexeddb/intversion-close-between-events.html fails.
513         https://bugs.webkit.org/show_bug.cgi?id=152096
514
515         Implementing Darin Adler's review feedback that came after the patch landed.
516
517         * bindings/js/JSIDBDatabaseCustom.cpp:
518         (WebCore::JSIDBDatabase::transaction): No need to explicitly cast to Vector<String>.
519
520 2015-12-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
521
522         JSC Builtins should use safe array methods
523         https://bugs.webkit.org/show_bug.cgi?id=151501
524
525         Reviewed by Darin Adler.
526
527         Using @push and @shift in internal arrays in lieu of push and shift.
528         This cannot be disrupted by user scripts except if arrays are also made accessible to user scripts.
529
530         Covered by added tests for ReadableStream constructs.
531
532         * Modules/mediastream/RTCPeerConnectionInternals.js:
533         (runNext):
534         (enqueueOperation):
535         * Modules/streams/ReadableStreamInternals.js:
536         (enqueueInReadableStream):
537         (readFromReadableStreamReader):
538         * Modules/streams/StreamInternals.js:
539         (dequeueValue):
540         (enqueueValueWithSize):
541
542 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
543
544         [TexMap] pixel coverage multiplication in TiledBackingStore can overflow
545         https://bugs.webkit.org/show_bug.cgi?id=152055
546
547         Reviewed by Carlos Garcia Campos.
548
549         The computation of the pixel coverage in TiledBackingStore can easily overflow
550         when the candidate size is relatively large (for instance when the backed
551         layer is transformed in a way that increases its perceived size). This can result
552         in missing tiles for this specific backing store, at least until the layer in
553         question is transformed again into a shape that produces a smaller candidate size.
554
555         To avoid the integer overflow, the multiplication is done in a safe manner,
556         defaulting to the max positive value an integer can hold in case the overflow
557         is detected.
558
559         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
560         (WebCore::TiledBackingStore::adjustForContentsRect):
561
562 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
563
564         [TexMap] Clean up BitmapTexturePool
565         https://bugs.webkit.org/show_bug.cgi?id=152073
566
567         Reviewed by Daniel Bates.
568
569         Move BitmapTexturePoolEntry class under the BitmapTexturePool class, renaming
570         it to simply Entry and keeping it private. Have the constructor take in an
571         rvalue reference to the RefPtr<BitmapTexture> object. Remove the static
572         compareTimeLastUsed() function and use a lambda directly in its place.
573
574         Remove the default BitmapTexturePool constructor, which isn't used anywhere.
575         Have the constructor and some methods accept or return RefPtr objects, possibly
576         via rvalue references. Clean up the header file by removing a few unnecessary
577         header includes and using forward declarations where possible.
578
579         In the BitmapTexturePool implementation file, mark the two const variables as
580         static. The ::acquireTexture() method now uses the std::find_if() algorithm
581         to find a fitting Entry object in the Vector. The same method is also moved
582         upwards so we follow the order of declaration in the header. ::createTexture()
583         inlines the return of the new expression into the adoptRef() call in the return
584         statement.
585
586         TextureMapperGL constructor is updated to pass a copied RefPtr object into the
587         BitmapTexturePool constructor.
588
589         * platform/graphics/texmap/BitmapTexturePool.cpp:
590         (WebCore::BitmapTexturePool::BitmapTexturePool):
591         (WebCore::BitmapTexturePool::acquireTexture):
592         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
593         (WebCore::BitmapTexturePool::createTexture):
594         * platform/graphics/texmap/BitmapTexturePool.h:
595         (WebCore::BitmapTexturePool::Entry::Entry):
596         (WebCore::BitmapTexturePool::Entry::markUsed):
597         (WebCore::BitmapTexturePoolEntry::BitmapTexturePoolEntry): Deleted.
598         (WebCore::BitmapTexturePoolEntry::markUsed): Deleted.
599         (WebCore::BitmapTexturePoolEntry::compareTimeLastUsed): Deleted.
600         * platform/graphics/texmap/TextureMapperGL.cpp:
601         (WebCore::TextureMapperGL::TextureMapperGL):
602
603 2015-12-10  Michael Catanzaro  <mcatanzaro@igalia.com>
604
605         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
606         https://bugs.webkit.org/show_bug.cgi?id=151533
607
608         Reviewed by Carlos Garcia Campos.
609
610         Remove the style context cache to simplify the code, drastically reduce the number of
611         expensive save/restore operations performed on style contexts, and avoid unwanted
612         side-effects in RenderThemeGtk::styleColor. This is also a speculative fix for improper
613         button rendering with certain custom themes, and a simplification that will make it easier
614         to fix bug #150550.
615
616         This change does have performance implications, which I intend to check on the perf bot
617         after landing to ensure that removing the cache does not have a significant negative impact
618         on performance; I have no clue whether this will be a net performance win or loss. However,
619         this is a bit tricky, because the bot is running GTK+ 3.16, whereas I expect save/restore
620         might be much more expensive in GTK+ 3.20, and I do not want to make performance decisions
621         except based on the latest GTK+ due to large changes in the implementation of
622         GtkStyleContext.
623
624         * rendering/RenderThemeGtk.cpp:
625         (WebCore::createStyleContext):
626         (WebCore::getStockIconForWidgetType):
627         (WebCore::getStockSymbolicIconForWidgetType):
628         (WebCore::RenderThemeGtk::initMediaColors):
629         (WebCore::RenderThemeGtk::adjustRepaintRect):
630         (WebCore::setToggleSize):
631         (WebCore::paintToggle):
632         (WebCore::RenderThemeGtk::setCheckboxSize):
633         (WebCore::RenderThemeGtk::setRadioSize):
634         (WebCore::RenderThemeGtk::paintButton):
635         (WebCore::getComboBoxMetrics):
636         (WebCore::RenderThemeGtk::paintMenuList):
637         (WebCore::RenderThemeGtk::paintTextField):
638         (WebCore::RenderThemeGtk::paintSliderTrack):
639         (WebCore::RenderThemeGtk::paintSliderThumb):
640         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
641         (WebCore::RenderThemeGtk::paintProgressBar):
642         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
643         (WebCore::RenderThemeGtk::paintInnerSpinButton):
644         (WebCore::styleColor):
645         (WebCore::gtkStyleChangedCallback): Deleted.
646         (WebCore::styleContextMap): Deleted.
647         (WebCore::getStyleContext): Deleted.
648
649 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
650
651         font-variant-caps does not work if the font does not support font features
652         https://bugs.webkit.org/show_bug.cgi?id=149774
653
654         Reviewed by Antti Koivisto.
655
656         This test implements synthesis for small-caps and all-small-caps. It does so by
657         moving font variant selection into a higher level (ComplexTextController).
658         In general, the approach is to use the pure font feature until we encounter
659         a character which needs to be uppercased, and which the font feature does not
660         support uppercasing. In this situation, we try again with synthesis. In this
661         case, synthesis means artificially uppercasing letters and rendering them with
662         a smaller font.
663
664         We require system support to know which glyphs a particular font feature supports.
665         Therefore, on operating systems which do not include this support, we will simply
666         say that the font feature does not support any glyphs.
667
668         Test: css3/font-variant-small-caps-synthesis.html
669               css3/font-variant-petite-caps-synthesis.html
670
671         * platform/graphics/Font.cpp:
672         (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc.
673         This function utilizes a cache.
674         * platform/graphics/Font.h:
675         (WebCore::Font::variantFont): Small caps should never go through this function
676         anymore.
677         * platform/graphics/FontCascade.h: Because we're moving variant selection into
678         a higher level, we remove the FontVariant argument from the lower-level call.
679         * platform/graphics/FontCascadeFonts.cpp:
680         (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style.
681         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto.
682         * platform/graphics/cocoa/FontCascadeCocoa.mm:
683         (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving
684         variant selection into a higher level, we remove the FontVariant argument from
685         the lower-level call.
686         * platform/graphics/cocoa/FontCocoa.mm:
687         (WebCore::Font::smallCapsSupportsCharacter):
688         (WebCore::Font::allSmallCapsSupportsCharacter):
689         (WebCore::smallCapsOpenTypeDictionary): Helper function for
690         smallCapsSupportsCharacter().
691         (WebCore::smallCapsTrueTypeDictionary): Ditto.
692         (WebCore::unionBitVectors):
693         (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported
694         glyphs.
695         (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto.
696         (WebCore::createDerivativeFont): Moving common code into its own helper function.
697         (WebCore::Font::createFontWithoutSmallCaps):
698         (WebCore::Font::platformCreateScaledFont): Use the common code.
699         * platform/graphics/mac/ComplexTextController.cpp:
700         (WebCore::capitalized): What is the capitalized form of a character?
701         (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core
702         logic of this patch. This includes the retry when we encounter a character which
703         is not supported by the font feature.
704         * platform/spi/cocoa/CoreTextSPI.h:
705
706 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
707
708         [TexMap] Remove the TEXMAP_OPENGL_ES_2 define
709         https://bugs.webkit.org/show_bug.cgi?id=152069
710
711         Reviewed by Alex Christensen.
712
713         Remove the TEXMAP_OPENGL_ES_2 macro define and clean up the code
714         that it was (not) guarding.
715
716         * platform/graphics/texmap/BitmapTexture.h:
717         * platform/graphics/texmap/BitmapTextureGL.cpp: Remove the TEXMAP_OPENGL_ES_2
718         guard. Keep the GL_UNSIGNED_INT_8_8_8_8_REV define for OS(DARWIN), but use
719         the GraphicsContext3D constants for other values.
720         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
721         (WebCore::BitmapTextureGL::initializeStencil): Remove the TEXMAP_OPENGL_ES_2
722         guard and default to calling the renderbufferStorage() function with the
723         GraphicsContext3D::STENCIL_INDEX8 argument.
724         * platform/graphics/texmap/BitmapTexturePool.h:
725         * platform/graphics/texmap/TextureMapper.h:
726         * platform/graphics/texmap/TextureMapperGL.cpp: Remove both the TEXMAP_OPENGL_ES_2
727         guard and the code it guarded. Because we were defining TEXMAP_OPENGL_ES_2 and not
728         USE_TEXMAP_OPENGL_ES_2, the guarded defines were always enforced, but they're never
729         actually used in this file anyway.
730
731 2015-12-09  Brady Eidson  <beidson@apple.com>
732
733         Modern IDB: storage/indexeddb/objectstore-basics.html fails.
734         https://bugs.webkit.org/show_bug.cgi?id=152101
735
736         Reviewed by Alex Christensen.
737
738         No new tests (Multiple tests updated to the new error messaging cover it).
739
740         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
741         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add plenty of detailed error messaging.
742
743 2015-12-09  Zalan Bujtas  <zalan@apple.com>
744
745         TextPainter: Make before and after selection painting more explicit.
746         https://bugs.webkit.org/show_bug.cgi?id=152104
747
748         Reviewed by Myles C. Maxfield.
749
750         Instead of swapping start end end positions and expecting TextPainter::drawTextOrEmphasisMarks()
751         to recognize it, we call painting with 0 - startPosition and endPosition - length.
752
753         No change in functionality.
754
755         * rendering/TextPainter.cpp:
756         (WebCore::TextPainter::drawTextOrEmphasisMarks):
757         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
758         (WebCore::TextPainter::paintText):
759         (WebCore::TextPainter::paintEmphasisMarksIfNeeded): Deleted.
760         (WebCore::TextPainter::paintTextWithStyle): Deleted.
761         * rendering/TextPainter.h:
762
763 2015-12-09  Daniel Bates  <dabates@apple.com>
764
765         [iOS] Suspend and resume device motion and device orientation updates when page is hidden and visible, respectively
766         https://bugs.webkit.org/show_bug.cgi?id=151840
767         <rdar://problem/23753931>
768
769         Reviewed by Simon Fraser.
770
771         * dom/Document.cpp:
772         (WebCore::Document::suspendDeviceMotionAndOrientationUpdates): Added.
773         (WebCore::Document::resumeDeviceMotionAndOrientationUpdates): Added.
774         (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Moved logic to suspend device motion and
775         orientation updates from here to Document::suspendDeviceMotionAndOrientationUpdates().
776         (WebCore::Document::suspendActiveDOMObjects): Modified to call Document::suspendDeviceMotionAndOrientationUpdates().
777         (WebCore::Document::resumeActiveDOMObjects): Modified to call Document::resumeDeviceMotionAndOrientationUpdates().
778         * dom/Document.h:
779         * page/Page.cpp:
780         (WebCore::Page::setIsVisibleInternal): Suspend device motion and orientation updates when the page is hidden and
781         resume updates when the page is visible.
782         (WebCore::Page::suspendDeviceMotionAndOrientationUpdates): Added.
783         (WebCore::Page::resumeDeviceMotionAndOrientationUpdates): Added.
784         * page/Page.h:
785
786 2015-12-09  Daniel Bates  <dabates@apple.com>
787
788         Unify iOS Frame::setTimersPaused() logic and Frame::{suspend, resume}ActiveDOMObjectsAndAnimations()
789         https://bugs.webkit.org/show_bug.cgi?id=152006
790
791         Reviewed by Simon Fraser.
792
793         Currently we have almost identical logic to suspend and resume a web page for iOS and non-iOS ports.
794         We should unify this logic instead of duplicating it.
795
796         * dom/ActiveDOMObject.h: Remove iOS-specific enumeration DocumentWillBePaused and standardize on
797         enumerator PageWillBeSuspended.
798         * dom/Document.cpp:
799         (WebCore::Document::didBecomeCurrentDocumentInFrame): Unify iOS and non-iOS-specific code.
800         (WebCore::Document::suspendScheduledTasks): Ignore subsequent calls to this function so long as the reason for
801         the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent call may occur as part of
802         handling a scroll or zoom gesture.
803         * dom/ScriptExecutionContext.cpp:
804         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ignore subsequent calls to this function
805         so long as the reason for the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent
806         call may occur as part of the process of a page being added to the page cache.
807         * html/HTMLMediaElement.cpp:
808         (WebCore::HTMLMediaElement::suspend): Remove case for ActiveDOMObject::DocumentWillBePaused as this
809         enumerator is being removed.
810         * page/DOMTimer.cpp:
811         (WebCore::DOMTimer::install): Write logic that used Frame::timersPaused() terms of
812         ScriptExecutionContext::activeDOMObjectsAreSuspended() as we are removing Frame::timersPaused().
813         (WebCore::DOMTimer::fired): Remove iOS-specific assertion with respect to Frame::timersPaused().
814         This function already asserts the equivalent condition that ScriptExecutionContext::activeDOMObjectsAreSuspended()
815         evaluates to false. Clean up iOS-specific code that depends on the ScriptExecutionContext being a
816         Document object by taking advantage of the fact that this assumption is true when shouldBeginObservingChanges
817         evaluates to true.
818         * page/Frame.cpp:
819         (WebCore::Frame::Frame): Remove instance variable m_timersPausedCount and unify the iOS and non-iOS logic.
820         (WebCore::Frame::suspendActiveDOMObjectsAndAnimations): Standardize on the iOS logic for suspending
821         DOM objects and animations because it is more comprehensive on what it suspends and works with the deferred
822         loading machinery (Page::setDefersLoading() - see remarks in Frame::resumeActiveDOMObjectsAndAnimations() for
823         more details). Specifically, make use of Frame::clearTimers() to suspend non-scripted animations (i.e. non-requestAnimationFrame()
824         animations), auto-scroll timer, and pending relayouts. And use Document::suspendScheduledTasks() to suspend
825         all other tasks, including WebSQL database callbacks, active DOM objects, scripted animations and execution of
826         <script async>/<script defer> JavaScript scripts.
827         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): Standardize on the iOS logic for resuming
828         DOM objects and animations for symmetry and because it works with the deferred loading machinery. We call
829         Document::resumeScheduledTasks() (which calls Document::resumeActiveDOMObjects()) instead of calling
830         Document::resumeActiveDOMObjects() directly because the former will ultimately process the queue of pending
831         tasks (Document::m_pendingTasks).
832         * page/Frame.h: Remove instance variable m_timersPausedCount.
833         (WebCore::Frame::timersPaused): Deleted.
834         * page/ios/FrameIOS.mm:
835         (WebCore::Frame::setTimersPaused): Write this function in terms of Page::{suspend, resume}ActiveDOMObjectsAndAnimations().
836         We need to keep this function for Legacy WebKit on iOS.
837         (WebCore::Frame::setTimersPausedInternal): Deleted.
838         * rendering/RenderElement.cpp:
839         (WebCore::shouldRepaintForImageAnimation): Remove iOS-specific code to early return when Frame::timersPaused()
840         evaluates to true. This function already has the equivalent code to early return when Document::activeDOMObjectsAreSuspended()
841         evaluates to true.
842
843 2015-12-09  Brady Eidson  <beidson@apple.com>
844
845         Modern IDB: storage/indexeddb/metadata.html fails
846         https://bugs.webkit.org/show_bug.cgi?id=152099
847
848         Reviewed by Alex Christensen.
849
850         Test: storage/indexeddb/modern/abort-objectstore-info.html
851               And at least one existing failure now passes.
852
853         We did not properly reset object store info when version change transactions aborted.
854
855         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
856         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
857         (WebCore::IDBClient::IDBObjectStore::rollbackInfoForVersionChangeAbort):
858         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
859         
860         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
861         (WebCore::IDBClient::IDBTransaction::abort):
862
863 2015-12-09  Simon Fraser  <simon.fraser@apple.com>
864
865         Adjust layer backing store format
866         https://bugs.webkit.org/show_bug.cgi?id=152097
867         rdar://problem/23305376
868
869         Reviewed by Tim Horton.
870         
871         Call setBackingStoreFormat() on UIWebView tile grid layers, and on compositing
872         layers which can allocate backing store.
873
874         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
875         (WebCore::setBackingStoreFormat):
876         (PlatformCALayerCocoa::commonInit):
877         * platform/ios/LegacyTileGridTile.mm:
878         (WebCore::setBackingStoreFormat):
879         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
880
881 2015-12-09  Brady Eidson  <beidson@apple.com>
882
883         Modern IDB: storage/indexeddb/intversion-close-between-events.html fails.
884         https://bugs.webkit.org/show_bug.cgi?id=152096
885
886         Reviewed by Alex Christensen.
887
888         No new tests (At least one failing test now passes).
889
890         * bindings/js/JSIDBDatabaseCustom.cpp:
891         (WebCore::JSIDBDatabase::transaction): In addition to JSArrays, treat DOMStringLists as a valid string sequence.
892     
893 2015-12-09  Andreas Kling  <akling@apple.com>
894
895         [iOS] ResourceUsageOverlay should work on iOS.
896         <https://webkit.org/b/152021>
897
898         Reviewed by Antti Koivisto.
899
900         Make ResourceUsageOverlay work on iOS and on Mac desktops with UI-side compositing.
901
902         * page/ResourceUsageOverlay.cpp:
903         (WebCore::ResourceUsageOverlay::initialize): Move the overlay to the top of the view on iOS for now.
904         * page/ResourceUsageOverlay.h:
905         * page/cocoa/ResourceUsageOverlayCocoa.mm:
906         (WebCore::createColor): Make a custom CGColor factory since we can't use CGColorCreateGenericRGB on iOS.
907         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
908         (WebCore::ResourceUsageOverlay::platformInitialize): Put the overlay CALayer into a container layer and
909         hook it up with GraphicsLayer::setContentsToPlatformLayer so it works with all compositing modes.
910         (WebCore::showText): Move CGContextSaveGState call to the top of the function to preserve everything.
911         (WebCore::drawGraphLabel):
912         (WebCore::drawCpuHistory):
913         (WebCore::drawGCHistory):
914         (WebCore::ResourceUsageOverlay::platformDraw): Flip the CGContext if needed.
915         (WebCore::runSamplerThread): Update the layer rects on each thread iteration. This shouldn't be
916         necessary but it papers over an issue where the containing layer would shrink down to 0x0 and
917         disappear. Added a FIXME for this.
918         * platform/spi/cocoa/MachVMSPI.h: Add purgeable VM SPI.
919
920 2015-12-09  Brady Eidson  <beidson@apple.com>
921
922         Modern IDB: storage/indexeddb/database-closepending-flag.html fails.
923         https://bugs.webkit.org/show_bug.cgi?id=152095
924
925         Reviewed by Alex Christensen.
926
927         No new tests (At least one failing test now passes).
928         
929         The server-side checks the closepending flag before dispatching the event to the client, 
930         but due to the inherent asynchronous race between server and client, the client needs to 
931         check its closePending flag as well.
932
933         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
934         (WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent): Don't fire if m_closePending is set.
935
936 2015-12-09  David Hyatt  <hyatt@apple.com>
937
938         Picture element needs to respond to dynamic viewport changes.
939         https://bugs.webkit.org/show_bug.cgi?id=152013
940         <rdar://problem/23766375>
941
942         Reviewed by Dean Jackson.
943
944         Added new tests in fast/picture.
945
946         * css/MediaQueryEvaluator.cpp:
947         (WebCore::MediaQueryEvaluator::evalCheckingViewportDependentResults):
948         Add new evaluation method that adds viewport dependent results to a vector. A follow-up patch
949         will refactor the style resolver code to use this function instead of the special style resolver one, in order to
950         get rid of the code duplication. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152089.
951
952         * css/MediaQueryEvaluator.h:
953         (WebCore::MediaQueryResult::MediaQueryResult):
954         * css/StyleResolver.h:
955         (WebCore::MediaQueryResult::MediaQueryResult): Deleted.
956         Move MediaQueryResult into a header since it is used in multiple places now and not just by the style
957         resolver.
958
959         * dom/Document.cpp:
960         (WebCore::Document::evaluateMediaQueryList):
961         (WebCore::Document::checkViewportDependentPictures):
962         (WebCore::Document::optimizedStyleSheetUpdateTimerFired):
963         (WebCore::Document::applyContentDispositionAttachmentSandbox):
964         (WebCore::Document::addViewportDependentPicture):
965         (WebCore::Document::removeViewportDependentPicture):
966         * dom/Document.h:
967         The document now maintains a HashSet of viewport-dependent pictures, and it checks them whenever the
968         viewport changes. If their media queries stay the same, then nothing happens. If they change, then
969         the <picture> will go back and re-check all its <source> elements to see what the new best candidate is.
970
971         * html/HTMLImageElement.cpp:
972         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
973         Revised to check for viewport dependencies and to cache viewport-dependent results on the <picture> elements.
974         When a <picture> is found to be viewport-dependent (or not) it is also added to or removed from the document's
975         set of tracked pictures.
976
977         * html/HTMLPictureElement.cpp:
978         (WebCore::HTMLPictureElement::HTMLPictureElement):
979         (WebCore::HTMLPictureElement::~HTMLPictureElement):
980         (WebCore::HTMLPictureElement::didMoveToNewDocument):
981         (WebCore::HTMLPictureElement::create):
982         (WebCore::HTMLPictureElement::sourcesChanged):
983         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
984         * html/HTMLPictureElement.h:
985         New caching of results and updating of the document HashSet when the picture gets destroyed or moves to
986         a different document.
987
988         * html/HTMLSourceElement.cpp:
989         (WebCore::HTMLSourceElement::parseAttribute):
990         * html/HTMLSourceElement.h:
991         Cache the media attribute in a parsed form. A follow-up patch will improve the <video>/<audio>
992         code to make use of this parsed result. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152090.
993
994 2015-12-09  Zalan Bujtas  <zalan@apple.com>
995
996         TextPainter: Rename start and end position to selectionStart and selectionEnd.
997         https://bugs.webkit.org/show_bug.cgi?id=152088
998
999         Reviewed by Myles C. Maxfield.
1000
1001         They actually mean selection start/end.
1002
1003         No change in functionality.
1004
1005         * rendering/InlineTextBox.cpp:
1006         (WebCore::InlineTextBox::paint):
1007         * rendering/TextPainter.cpp:
1008         (WebCore::TextPainter::TextPainter):
1009         (WebCore::TextPainter::paintText):
1010         * rendering/TextPainter.h:
1011
1012 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
1013
1014         AX: [GTK] Anonymous render block flow elements should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL
1015         https://bugs.webkit.org/show_bug.cgi?id=152070
1016
1017         Reviewed by Mario Sanchez Prada.
1018
1019         Map the element to WebCore AccessibilityRole DivRole for GTK. This is being
1020         done in the shared layer rather than in the platform layer because we want all
1021         subsequent logic to treat anonymous render block flow elements as divs.
1022
1023         No new tests. We already have sufficient test coverage. The expectations
1024         been updated accordingly.
1025
1026         * accessibility/AccessibilityRenderObject.cpp:
1027         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1028
1029 2015-12-09  Keith Rollin  <krollin@apple.com>
1030
1031         form.elements should reflect the element ordering after the HTML tree builder algorithm
1032         https://bugs.webkit.org/show_bug.cgi?id=148870
1033         rdar://problem/22589879
1034
1035         Reviewed by Ryosuke Niwa.
1036
1037         form.elements should return form-associated elements in tree order.
1038         However, when presented with an HTML fragment like the following,
1039         forms.elements is not built in tree order. Instead, the elements
1040         appear in forms.element in the same order they appear in the HTML --
1041         that is in the same order as they are parsed.
1042
1043         <form id=form>
1044             <table>
1045                 <tr>
1046                     <td><input type="radio" name="radio1" id="r1" value=1></td>
1047                     <td><input type="radio" name="radio2" id="r2" value=2></td>
1048                     <input type="radio" name="radio0" id="r0" value=0>
1049                 </tr>
1050             </table>
1051         </form>
1052
1053         The reason why elements appear in forms.elements in parse order is
1054         because they register themselves with the designated form when they
1055         are created. At this time, they are not in the DOM tree, so the form
1056         can only assume that the element will be appended to the DOM tree,
1057         with the result that it records the elements in the HTML fragment
1058         above as [r1, r2, r0].
1059
1060         However, it's not always the case that the newly-created element will
1061         be appended to the current tree. In the HTML fragment above, the r0
1062         input element is hoised out of the table element. It ends up being the
1063         preceding sibling of the table element, with the result that the
1064         actual tree-order of the input elements is [r0, r1, r2].
1065
1066         Because the problem is due to registering form-associated elements
1067         with the form *before* the elements are added to the DOM tree, the
1068         solution is to defer that registration until afterwards. With the new
1069         element in the tree, the form can now use its current location in the
1070         tree to correctly place the element in form.elements.
1071
1072         Existing tests now pass:
1073         - imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-elements-nameditem-02-html
1074
1075         * html/FormAssociatedElement.cpp:
1076         (WebCore::FormAssociatedElement::FormAssociatedElement):
1077         (WebCore::FormAssociatedElement::insertedInto):
1078         (WebCore::FormAssociatedElement::removedFrom):
1079         (WebCore::FormAssociatedElement::formRemovedFromTree):
1080         (WebCore::FormAssociatedElement::formWillBeDestroyed):
1081         * html/FormAssociatedElement.h:
1082         * html/HTMLFormControlElement.cpp:
1083         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
1084         * html/HTMLImageElement.cpp:
1085         (WebCore::HTMLImageElement::HTMLImageElement):
1086         (WebCore::HTMLImageElement::insertedInto):
1087         (WebCore::HTMLImageElement::removedFrom):
1088         * html/HTMLImageElement.h:
1089         * html/HTMLObjectElement.cpp:
1090         (WebCore::HTMLObjectElement::HTMLObjectElement):
1091
1092 2015-12-09  Gwang Yoon Hwang  <yoon@igalia.com>
1093
1094         [ThreadedCompositor] Support HTML5 Video
1095         https://bugs.webkit.org/show_bug.cgi?id=143301
1096
1097         Reviewed by Žan Doberšek.
1098
1099         This patch implements HTML5 Video supports in Threaded Compositor.
1100
1101         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1102         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
1103         Added to support GStreamer GL by ensuring unmapping of the swapped
1104         GstVideoFrame performed at GStreamer GL's gl thread.
1105         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
1106         Modified to upload decoded frame to the given texture instead of
1107         creating a texture itself because we should use a texture from the
1108         proxy when we are using the threaded compositor.
1109         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1110         Implements two ways to send a texture from GStreamer to the compositor.
1111         1. If we are not using GStreamer GL, we are going to acquire a free texture
1112         from a TextureMapperPlatformLayerProxy and upload the decoded frame to the
1113         texture. This should be done at the compositing thread because we
1114         don't have a Gst's GL thread.
1115         2. If we are using GStreamer GL, we map a texture for the given frame
1116         and passes it to the compositing thread. The mapped frame will be
1117         freed if it is swapped out or the layer is removed.
1118
1119         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
1120         Modified to aquire a new texture itself.
1121
1122         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
1123         Adds a way to pass a function to the compositing thread to allocate /
1124         upload textures at the compositing thread.
1125
1126
1127 2015-12-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1128
1129         [Streams API] pipeThrough test failing
1130         https://bugs.webkit.org/show_bug.cgi?id=152061
1131
1132         Reviewed by Youenn Fablet.
1133
1134         Test: imported/w3c/web-platform-tests/streams-api/readable-streams/pipe-through.html
1135
1136         * Modules/streams/ReadableStream.js:
1137         (pipeThrough): Mimic destructuring for the streams parameter.
1138
1139 2015-12-09  Frederic Wang  <fred.wang@free.fr>
1140
1141         Bad position of large operators inside an munderover element
1142         https://bugs.webkit.org/show_bug.cgi?id=151916
1143
1144         Reviewed by Alejandro G. Castro.
1145
1146         Test: mathml/opentype/large-operators-munderover.html
1147
1148         * rendering/mathml/RenderMathMLOperator.h:
1149         (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator.
1150         * rendering/mathml/RenderMathMLUnderOver.cpp:
1151         (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators.
1152
1153 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1154
1155         [TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data access
1156         https://bugs.webkit.org/show_bug.cgi?id=152053
1157
1158         Reviewed by Martin Robinson.
1159
1160         TextureMapperTiledBackingStore should call ImageObserver::didDraw() on the Image's
1161         observer after updating the tile with the Image's data. This way the CachedImage
1162         (i.e. the observer) can mark the data access with the current timestamp, avoiding
1163         removing the decoded data in the very near future during a cache purge.
1164
1165         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1166         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
1167
1168 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1169
1170         Make MainThreadSharedTimerGtk implementation GLib-specific
1171         https://bugs.webkit.org/show_bug.cgi?id=152044
1172
1173         Reviewed by Carlos Garcia Campos.
1174
1175         MainThreadSharedTimerGtk has implementation that only directly depends
1176         on GLib, and not GTK+. Because of that it can be moved under
1177         Source/WebCore/platform/glib and slightly renamed.
1178
1179         * PlatformGTK.cmake:
1180         * platform/glib/MainThreadSharedTimerGLib.cpp: Renamed from Source/WebCore/platform/gtk/MainThreadSharedTimerGtk.cpp.
1181         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
1182         (WebCore::MainThreadSharedTimer::setFireInterval):
1183         (WebCore::MainThreadSharedTimer::stop):
1184         (WebCore::MainThreadSharedTimer::invalidate):
1185         * platform/gtk/MainThreadSharedTimerGtk.cpp:
1186         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): Deleted.
1187         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
1188         (WebCore::MainThreadSharedTimer::stop): Deleted.
1189         (WebCore::MainThreadSharedTimer::invalidate): Deleted.
1190
1191 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1192
1193         [TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4
1194         https://bugs.webkit.org/show_bug.cgi?id=152042
1195
1196         Reviewed by Martin Robinson.
1197
1198         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
1199         (WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out
1200         the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4
1201         and fill that via the TransformationMatrix::toColumnMajorFloatArray() method
1202         called on the passed-in TransformationMatrix.
1203
1204 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1205
1206         [Soup] Attach the SocketStreamHandleSoup write-ready source to the thread-default context
1207         https://bugs.webkit.org/show_bug.cgi?id=152041
1208
1209         Reviewed by Carlos Garcia Campos.
1210
1211         * platform/network/soup/SocketStreamHandleSoup.cpp:
1212         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Attach the
1213         write-ready source to the thread-default context, instead of implicitly
1214         relying on the default context for dispatching.
1215
1216 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1217
1218         [Soup] SocketStreamHandle should call g_source_destroy() on the write-ready source
1219         https://bugs.webkit.org/show_bug.cgi?id=152040
1220
1221         Reviewed by Carlos Garcia Campos.
1222
1223         * platform/network/soup/SocketStreamHandleSoup.cpp:
1224         (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Instead of
1225         calling the g_source_get_id()-g_source_remove() pair, destroy the source via
1226         the g_source_destroy() call. Also use nullptr to clear out the pointer
1227         variable.
1228
1229 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
1230
1231         Make AudioBusGtk implementation GLib-specific
1232         https://bugs.webkit.org/show_bug.cgi?id=152049
1233
1234         Reviewed by Philippe Normand.
1235
1236         AudioBusGtk only depends on GLib, so it should be moved to
1237         Source/WebCore/platform/audio/glib and the implementation file
1238         renamed to AudioBusGLib.cpp.
1239
1240         The hard-coded webkitgtk path component can be addressed later.
1241
1242         * PlatformGTK.cmake: Update the build target.
1243         * platform/audio/glib/AudioBusGLib.cpp: Renamed from Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp.
1244         (WebCore::AudioBus::loadPlatformResource):
1245         * platform/audio/gtk/AudioBusGtk.cpp:
1246         (WebCore::AudioBus::loadPlatformResource): Deleted.
1247
1248 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
1249
1250         AX: [EFL] Consider deferring to WebCore Accessibility for table exposure
1251         https://bugs.webkit.org/show_bug.cgi?id=144898
1252
1253         Reviewed by Darin Adler.
1254
1255         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
1256         for WebKitEfl.
1257
1258         No new tests. Several existing tests already cover table exposure. They have
1259         been updated accordingly.
1260
1261         * accessibility/AccessibilityTable.cpp:
1262         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
1263
1264 2015-12-08  Simon Fraser  <simon.fraser@apple.com>
1265
1266         Convert resetAnimValToBaseVal take a reference to a SVGAnimatedType
1267         https://bugs.webkit.org/show_bug.cgi?id=152036
1268
1269         Reviewed by Zalan Bujtas.
1270         
1271         Change resetAnimValToBaseVal() to take a reference at the last argument.
1272
1273         * svg/SVGAnimateElementBase.cpp:
1274         (WebCore::SVGAnimateElementBase::resetAnimatedType):
1275         * svg/SVGAnimatedAngle.cpp:
1276         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
1277         * svg/SVGAnimatedAngle.h:
1278         * svg/SVGAnimatedBoolean.cpp:
1279         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
1280         * svg/SVGAnimatedBoolean.h:
1281         * svg/SVGAnimatedColor.h:
1282         * svg/SVGAnimatedEnumeration.cpp:
1283         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
1284         * svg/SVGAnimatedEnumeration.h:
1285         * svg/SVGAnimatedInteger.cpp:
1286         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
1287         * svg/SVGAnimatedInteger.h:
1288         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
1289         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
1290         * svg/SVGAnimatedIntegerOptionalInteger.h:
1291         * svg/SVGAnimatedLength.cpp:
1292         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
1293         * svg/SVGAnimatedLength.h:
1294         * svg/SVGAnimatedLengthList.cpp:
1295         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
1296         * svg/SVGAnimatedLengthList.h:
1297         * svg/SVGAnimatedNumber.cpp:
1298         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
1299         * svg/SVGAnimatedNumber.h:
1300         * svg/SVGAnimatedNumberList.cpp:
1301         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
1302         * svg/SVGAnimatedNumberList.h:
1303         * svg/SVGAnimatedNumberOptionalNumber.cpp:
1304         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
1305         * svg/SVGAnimatedNumberOptionalNumber.h:
1306         * svg/SVGAnimatedPath.cpp:
1307         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
1308         * svg/SVGAnimatedPath.h:
1309         * svg/SVGAnimatedPointList.cpp:
1310         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
1311         * svg/SVGAnimatedPointList.h:
1312         * svg/SVGAnimatedPreserveAspectRatio.cpp:
1313         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
1314         * svg/SVGAnimatedPreserveAspectRatio.h:
1315         * svg/SVGAnimatedRect.cpp:
1316         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
1317         * svg/SVGAnimatedRect.h:
1318         * svg/SVGAnimatedString.cpp:
1319         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
1320         * svg/SVGAnimatedString.h:
1321         * svg/SVGAnimatedTransformList.cpp:
1322         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
1323         * svg/SVGAnimatedTransformList.h:
1324         * svg/SVGAnimatedTypeAnimator.h:
1325         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
1326         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
1327
1328 2015-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
1329
1330         Remove Mavericks-specific code from FontCacheMac
1331         https://bugs.webkit.org/show_bug.cgi?id=152030
1332
1333         Reviewed by Simon Fraser.
1334
1335         Mavericks is no longer a supported platform.
1336
1337         No new tests because there is no behavior change.
1338
1339         * platform/graphics/mac/FontCacheMac.mm:
1340         (WebCore::platformLookupFallbackFont):
1341         (WebCore::platformFontWithFamilySpecialCase): Deleted.
1342
1343 2015-12-08  Brady Eidson  <beidson@apple.com>
1344
1345         Modern IDB: storage/indexeddb/objectstore-cursor.html fails.
1346         https://bugs.webkit.org/show_bug.cgi?id=152023
1347
1348         Reviewed by Alex Christensen.
1349
1350         No new tests (At least one failing test now passes).
1351
1352         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1353         (WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor):
1354         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange): Make sure the
1355           found iterator is actually in the target range.
1356
1357 2015-12-08  Jer Noble  <jer.noble@apple.com>
1358
1359         Changing <video> src during 'ended' event can leave screen sleep disabled
1360         https://bugs.webkit.org/show_bug.cgi?id=152018
1361
1362         Reviewed by Eric Carlson.
1363
1364         Resetting a HTMLMediaElement's src during 'ended' introduces a race condition: whether
1365         the 'mediaPlayerRateChanged()' notification will fire before createMediaPlayer() destroys
1366         the old MediaPlayer firing said notification.
1367
1368         To break the race condition, always update the sleep disabling assertion after destroying
1369         the media player (by creating a new one).
1370
1371         * html/HTMLMediaElement.cpp:
1372         (WebCore::HTMLMediaElement::createMediaPlayer):
1373
1374 2015-12-08  Brady Eidson  <beidson@apple.com>
1375
1376         Modern IDB: Fire blocked events for delete requests that are blocked.
1377         https://bugs.webkit.org/show_bug.cgi?id=152015
1378
1379         Reviewed by Alex Christensen.
1380
1381         No new tests (Previous failing tests now pass, and previously timing-out tests now complete).
1382
1383         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1384         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase):
1385         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
1386         (WebCore::IDBServer::UniqueIDBDatabase::deleteOrRunTransactionsTimerFired):
1387         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1388
1389 2015-12-08  Brady Eidson  <beidson@apple.com>
1390
1391         Modern IDB: Fire blocked events for upgrade requests that are blocked.
1392         https://bugs.webkit.org/show_bug.cgi?id=152007
1393
1394         Reviewed by Alex Christensen.
1395
1396         Test: storage/indexeddb/modern/blocked-open-db-requests.html
1397               And some that used to fail now pass.
1398               And some that used to timeout now complete.
1399
1400         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
1401         (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked):
1402         * Modules/indexeddb/client/IDBConnectionToServer.h:
1403
1404         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1405         (WebCore::IDBClient::IDBDatabase::IDBDatabase):
1406
1407         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1408         (WebCore::IDBClient::IDBOpenDBRequest::requestBlocked):
1409         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1410
1411         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1412         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1413
1414         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
1415         (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
1416         * Modules/indexeddb/server/IDBConnectionToClient.h:
1417         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
1418
1419         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1420         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): When a request that would
1421           result in a version change transaction is blocked by open connections, notify it.
1422
1423         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1424         (WebCore::InProcessIDBServer::notifyOpenDBRequestBlocked):
1425         * Modules/indexeddb/shared/InProcessIDBServer.h:
1426
1427 2015-12-08  Per Arne Vollan  <peavo@outlook.com>
1428
1429         [WinCairo] Compile error.
1430         https://bugs.webkit.org/show_bug.cgi?id=152008
1431
1432         Reviewed by Brent Fulgham.
1433
1434         GLuint is undefined.
1435
1436         * platform/graphics/GraphicsContext3D.h:
1437
1438 2015-12-08  Zalan Bujtas  <zalan@apple.com>
1439
1440         Light cleanup in TextPainter.
1441         https://bugs.webkit.org/show_bug.cgi?id=151994
1442
1443         Reviewed by Darin Adler.
1444
1445         No change in functionality.
1446
1447         * rendering/TextPainter.cpp:
1448         (WebCore::TextPainter::TextPainter):
1449         * rendering/TextPainter.h: Address post review comment.
1450         (WebCore::ShadowApplier::isLastShadowIteration):
1451         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):
1452
1453 2015-12-08  Zalan Bujtas  <zalan@apple.com>
1454
1455         Do not insert positioned renderers to multiple gPositionedDescendantsMap.
1456         https://bugs.webkit.org/show_bug.cgi?id=151878
1457         rdar://problem/22229889
1458
1459         Reviewed by Simon Fraser.
1460
1461         We insert positioned renderers into a static map (RenderBlock::gPositionedDescendantsMap) to keep track of them.
1462         This static map is at block level. A particular absolute positioned object is added to its closest ancestor that
1463         returns true for RenderElement::canContainAbsolutelyPositionedObjects().
1464         canContainAbsolutelyPositionedObjects() returns true if the ancestor is either positioned or has transform.
1465         If this container's style changes so that it's no longer positioned and it has no transform anymore,
1466         we need to clear its static map of positioned objects (they'll get re-inserted to another ancestor at next layout).
1467
1468         This patch addresses the case when the renderer does not have transforms anymore.
1469
1470         Test: fast/block/positioning/crash-when-transform-is-removed.html
1471
1472         * rendering/RenderBlock.cpp:
1473         (WebCore::RenderBlock::styleWillChange):
1474
1475 2015-12-08  Eric Carlson  <eric.carlson@apple.com>
1476
1477         [MediaStream] Rename UserMediaClient and UserMediaController methods
1478         https://bugs.webkit.org/show_bug.cgi?id=152001
1479
1480         Reviewed by Brady Eidson.
1481
1482         No new tests, no behavior change.
1483
1484         * Modules/mediastream/UserMediaClient.h:
1485         (WebCore::UserMediaClient::~UserMediaClient):
1486         * Modules/mediastream/UserMediaController.h:
1487         (WebCore::UserMediaController::client):
1488         (WebCore::UserMediaController::from):
1489         (WebCore::UserMediaController::requestUserMediaAccess):
1490         (WebCore::UserMediaController::cancelUserMediaAccessRequest):
1491         (WebCore::UserMediaController::requestPermission): Deleted.
1492         (WebCore::UserMediaController::cancelRequest): Deleted.
1493         * Modules/mediastream/UserMediaRequest.cpp:
1494         (WebCore::UserMediaRequest::constraintsValidated):
1495         (WebCore::UserMediaRequest::contextDestroyed):
1496         * platform/mock/UserMediaClientMock.h:
1497
1498 2015-12-08  Jer Noble  <jer.noble@apple.com>
1499
1500         [iOS] Do not exit fullscreen mode during auto-PiP.
1501         https://bugs.webkit.org/show_bug.cgi?id=151889
1502
1503         Reviewed by Darin Adler.
1504
1505         When auto-PiPing, do not exit fullscreen mode, as that causes a two-step animation upon returing from auto-PiP.
1506
1507         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1508         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Handle the case where we open Safari after an
1509             auto-PiP by clicking on a link; if so, hide the fullscreen window.
1510         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Do not exit fullscreen during auto-PiP.
1511         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Ditto.
1512
1513 2015-12-08  Per Arne Vollan  <peavo@outlook.com>
1514
1515         [WinCairo] Remove unneeded function.
1516         https://bugs.webkit.org/show_bug.cgi?id=151989
1517
1518         Reviewed by Brent Fulgham.
1519
1520         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1521         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
1522         (MFCreateMediaType): Deleted.
1523
1524 2015-12-08  Jer Noble  <jer.noble@apple.com>
1525
1526         [iOS] Adopt WebFullScreenVideoRootViewController.
1527         https://bugs.webkit.org/show_bug.cgi?id=151996
1528
1529         Reviewed by Dan Bernstein.
1530
1531         Adopt WebFullScreenVideoRootViewController from WebKitAdditions. If it is not available, create and use
1532         a generic UIViewController subclass.
1533
1534         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1535         (createFullScreenVideoRootViewControllerClass):
1536         (allocWebFullScreenVideoRootViewControllerInstance):
1537         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1538
1539 2015-12-08  Andy Estes  <aestes@apple.com>
1540
1541         ImmutableNFANodeBuilder's move constructor moves an uninitialized member variable into itself
1542         https://bugs.webkit.org/show_bug.cgi?id=151982
1543
1544         Reviewed by Darin Adler.
1545
1546         * contentextensions/ImmutableNFANodeBuilder.h:
1547         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder):
1548
1549 2015-12-08  Andreas Kling  <akling@apple.com>
1550
1551         [Cocoa] ResourceUsageOverlay should query kernel for VM page size.
1552         <https://webkit.org/b/151920>
1553
1554         Reviewed by Andy Estes.
1555
1556         Read the vm.pagesize sysctl to find the correct page size for memory usage calculations.
1557         This fixes broken math on systems that have different hw.pagesize and vm.pagesize.
1558
1559         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1560         (WebCore::vmPageSize):
1561         (WebCore::pagesPerVMTag):
1562         (WebCore::runSamplerThread):
1563
1564 2015-12-08  Chris Dumez  <cdumez@apple.com>
1565
1566         Add diagnostic logging to measure speculative revalidation accuracy
1567         https://bugs.webkit.org/show_bug.cgi?id=151953
1568         <rdar://problem/23092196>
1569
1570         Reviewed by Darin Adler.
1571
1572         Add diagnostic logging to measure speculative revalidation accuracy.
1573
1574         * page/DiagnosticLoggingKeys.cpp:
1575         (WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey):
1576         (WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey):
1577         (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey):
1578         (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey):
1579         (WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey):
1580         (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey):
1581         (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey):
1582         * page/DiagnosticLoggingKeys.h:
1583
1584 2015-12-08  Brady Eidson  <beidson@apple.com>
1585
1586         Modern IDB: storage/indexeddb/index-cursor.html fails.
1587         https://bugs.webkit.org/show_bug.cgi?id=151973
1588
1589         Reviewed by Darin Adler.
1590
1591         No new tests (At least one failing test now passes).
1592
1593         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1594         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor): When the initial cursor creation
1595           generates an iterator outside of the cursor's IDBKeyRange, invalidate the iterator.
1596           
1597 2015-12-08  Joanmarie Diggs  <jdiggs@igalia.com>
1598
1599         [EFL] some ax tests have been failed since r186692
1600         https://bugs.webkit.org/show_bug.cgi?id=146887
1601
1602         Reviewed by Mario Sanchez Prada.
1603
1604         The tests were failing because there are now two WebCore accessibility
1605         roles which need to implement the AtkTable interface: TableRole and
1606         GridRole. Because the latter was not added in r186692, any tests with
1607         ARIA role grid that accessed cells via coordinates stopped working.
1608
1609         No new tests; instead unskipped all the broken table tests which now pass.
1610
1611         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1612         (getInterfaceMaskFromObject):
1613
1614 2015-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
1615
1616         [ThreadedCompositor] Add support for Cairo GL-backed ImageBuffer.
1617         https://bugs.webkit.org/show_bug.cgi?id=151986
1618
1619         Reviewed by Žan Doberšek.
1620
1621         This patch adds a support for accelerated 2d canvas which uses cairo-gl as its
1622         backend to the threaded compositor. Basically, it applies same way to support
1623         WebGL for the threaded compositor.
1624
1625         Unfortunately, we cannot swap the buffer for the accelerated 2d canvas because
1626         it should preserve the buffer of the previous frame when drawing new contents.
1627         Because of that, the surface of the accelerated 2d canvas will be copied for
1628         each frame.
1629
1630         * platform/graphics/cairo/ImageBufferCairo.cpp:
1631         (WebCore::ImageBufferData::ImageBufferData):
1632         (WebCore::ImageBufferData::createCompositorBuffer): Prepare a texture
1633         surface to push the rendered result to the compositing thread.
1634         (WebCore::ImageBufferData::swapBuffersIfNeeded): Copies the contents
1635         of the canvas's surface to the compositing texture.
1636         (WebCore::ImageBufferData::createCairoGLSurface): Moved to the inside
1637         of ImageBufferData.
1638
1639 2015-12-08  Joanmarie Diggs  <jdiggs@igalia.com>
1640
1641         [GTK] 15 accessibility tests fail since r186692.
1642         https://bugs.webkit.org/show_bug.cgi?id=148938
1643
1644         Reviewed by Mario Sanchez Prada.
1645
1646         Failing tests rebaselined.
1647
1648         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1649         (atkRole): Treat GridCellRole and CellRole the same.
1650         (roleIsTextType): Treat GridCellRole and CellRole the same.
1651
1652 2015-12-08  Frederic Wang  <fred.wang@free.fr>
1653
1654         [cairo] Solid stroke of lines with thickness less than 1 pixel broken after r191658
1655         https://bugs.webkit.org/show_bug.cgi?id=151947
1656
1657         Reviewed by Martin Robinson.
1658
1659         Test: mathml/presentation/radical-bar-visibility.html
1660
1661         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1662         (WebCore::GraphicsContext::drawLine): Force a minimal thickness of 1px
1663
1664 2015-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
1665
1666         [ThreadedCompositor] Support WebGL for OpenGL.
1667         https://bugs.webkit.org/show_bug.cgi?id=143300
1668
1669         Reviewed by Žan Doberšek.
1670
1671         To remove pixel transfer operation, this patch adds m_compositorFBO which uses same depth and stencil
1672         buffer with m_fbo but uses m_compositorTexture as a color attachment in GraphicsContext3D.
1673         Because switching target framebuffer is cheaper than pixel transfer operation and switching color
1674         attachment of m_fbo. In Threaded Compositor, when WebGL renders a scene, prepareTexture swaps
1675         m_fbo with m_compositorFBO and send the color attachment to the compositor thread.
1676         This patch only supports WebGL for OpenGL. OpenGLES will be covered in following-up patches.
1677
1678         No new tests needed.
1679
1680         * platform/graphics/GraphicsContext3D.h:
1681         * platform/graphics/GraphicsContext3DPrivate.cpp:
1682         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
1683         (WebCore::GraphicsContext3DPrivate::proxy):
1684         (WebCore::GraphicsContext3DPrivate::swapBuffersIfNeeded):
1685         Implement interfaces to pass a rendered texture to the compositing
1686         thread.
1687         * platform/graphics/GraphicsContext3DPrivate.h:
1688         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1689         (WebCore::GraphicsContext3D::GraphicsContext3D):
1690         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1691         Create additional compositing texture and FBO to swaping buffers for
1692         threaded compositor.
1693         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1694         (WebCore::GraphicsContext3D::reshapeFBOs):
1695         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
1696         Split attaching depth and stencil buffer codes from reshapeFBOs
1697         to make complete framebuffer with not only m_fbo but m_compositorFBO also.
1698         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1699         (WebCore::GraphicsContext3D::prepareTexture):
1700         If we are in the threaded compositor, we will swap m_fbo with
1701         m_compositorFBO instead of copying it.
1702
1703 2015-12-07  Zalan Bujtas  <zalan@apple.com>
1704
1705         Make paintTextWithShadows a member function (TextPainter).
1706         https://bugs.webkit.org/show_bug.cgi?id=151979
1707
1708         Reviewed by Simon Fraser.
1709
1710         This patch also simplifies paintTextWithShadows and
1711         rearranges some of the functions' arguments. 
1712
1713         No change in functionality.
1714
1715         * rendering/TextPainter.cpp:
1716         (WebCore::TextPainter::drawTextOrEmphasisMarks):
1717         (WebCore::TextPainter::paintTextWithShadows):
1718         (WebCore::TextPainter::paintEmphasisMarksIfNeeded):
1719         (WebCore::TextPainter::paintTextWithStyle):
1720         (WebCore::TextPainter::paintText):
1721         (WebCore::drawTextOrEmphasisMarks): Deleted.
1722         (WebCore::paintTextWithShadows): Deleted.
1723         * rendering/TextPainter.h:
1724
1725 2015-12-07  Brady Eidson  <beidson@apple.com>
1726
1727         Modern IDB: storage/indexeddb/factory-deletedatabase.html fails.
1728         https://bugs.webkit.org/show_bug.cgi?id=151966
1729
1730         Reviewed by Sam Weinig.
1731
1732         No new tests (At least one failing test now passes).
1733
1734         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1735         (WebCore::IDBClient::IDBOpenDBRequest::onDeleteDatabaseSuccess): The spec says that the result of
1736           deleteDatabase should be undefined. Without explicitly making it undefined, it's incorrectly null.
1737
1738 2015-12-07  Brady Eidson  <beidson@apple.com>
1739
1740         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
1741         https://bugs.webkit.org/show_bug.cgi?id=151961
1742
1743         Reviewed by Alex Christensen.
1744
1745         No new tests (At least one failing test now passes).
1746
1747         When an index cursor's iterator was invalidated, there were some cases where it did 
1748         not correctly find the next iterator to pick up where it left off.
1749
1750         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1751         (WebCore::IDBClient::IDBCursor::update):
1752         (WebCore::IDBClient::IDBCursor::deleteFunction):
1753         
1754         * Modules/indexeddb/server/IndexValueStore.cpp:
1755         (WebCore::IDBServer::IndexValueStore::find):
1756         (WebCore::IDBServer::IndexValueStore::loggingString):
1757         * Modules/indexeddb/server/IndexValueStore.h:
1758
1759 2015-12-07  Zalan Bujtas  <zalan@apple.com>
1760
1761         Refactor TextPainter::paintText() into sub methods.
1762         https://bugs.webkit.org/show_bug.cgi?id=151962
1763
1764         Reviewed by Myles C. Maxfield.
1765
1766         No change in functionality.
1767
1768         * rendering/TextPainter.cpp:
1769         (WebCore::TextPainter::paintTextWithEmphasisIfNeeded):
1770         (WebCore::TextPainter::paintTextWithStyle):
1771         (WebCore::TextPainter::paintText):
1772         * rendering/TextPainter.h:
1773
1774 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1775
1776         [GTK] Clean up virtual functions in MediaPlayerPrivateGStreamerBase
1777         https://bugs.webkit.org/show_bug.cgi?id=151940
1778
1779         Reviewed by Carlos Garcia Campos.
1780
1781         - Using 'override' when appropriate
1782         - Explicitly marking methods as virtual when they are inherently virtual
1783
1784         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1785
1786 2015-12-07  Saam barati  <sbarati@apple.com>
1787
1788         Add op_watchdog opcode that is generated when VM has a watchdog
1789         https://bugs.webkit.org/show_bug.cgi?id=151954
1790
1791         Reviewed by Mark Lam.
1792
1793         No new tests because JSC already has tests for this.
1794
1795         * bindings/js/WorkerScriptController.cpp:
1796         (WebCore::WorkerScriptController::scheduleExecutionTermination):
1797         (WebCore::WorkerScriptController::isTerminatingExecution):
1798
1799 2015-12-07  Brian Burg  <bburg@apple.com>
1800
1801         Web Inspector: Uncaught Exception page should have better styles and handle more error cases
1802         https://bugs.webkit.org/show_bug.cgi?id=151923
1803
1804         Reviewed by Timothy Hatcher.
1805
1806         Add a check for InspectorFrontendAPI before calling it. This can fail
1807         easily if an uncaught exception stalls initial loading, or whenever
1808         the Inspector frontend is reloaded.
1809
1810         * inspector/InspectorFrontendClientLocal.cpp:
1811         (WebCore::InspectorFrontendClientLocal::evaluateOnLoad):
1812
1813 2015-12-07  Beth Dakin  <bdakin@apple.com>
1814
1815         Hook up request and show for typing candidates in WK1
1816         https://bugs.webkit.org/show_bug.cgi?id=151831
1817         -and corresponding-
1818         <rdar://problem/23751214>
1819
1820         Reviewed by Enrica Casucci.
1821
1822         New SPI that is needed.
1823         * WebCore.xcodeproj/project.pbxproj:
1824         * platform/spi/mac/NSSpellCheckerSPI.h: Added.
1825
1826         Request candidates for editable content whenever selection changes.
1827         * editing/Editor.cpp:
1828         (WebCore::Editor::respondToChangedSelection):
1829
1830         Implement requestCandidatesForSelection on the EditorClient.
1831         * loader/EmptyClients.h:
1832         * page/EditorClient.h:
1833         (WebCore::EditorClient::requestCandidatesForSelection):
1834
1835 2015-12-07  Brady Eidson  <beidson@apple.com>
1836
1837         Modern IDB: Fix "old versions" when upgrading databases.
1838         https://bugs.webkit.org/show_bug.cgi?id=151948
1839
1840         Reviewed by Alex Christensen.
1841
1842         No new tests (5 failing tests now pass, and updated results for a 6th test).
1843
1844         This includes the old version on the IDBVersionChangeEvent, as well as the version the 
1845         IDBDatabase is left with if the version change transaction is aborted.
1846
1847         Primary mechanism of the fix is to include the original IDBDatabaseInfo along with 
1848         IDBTransactionInfos that represent version change transactions.
1849
1850         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1851         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
1852         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
1853
1854         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1855         (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
1856
1857         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1858         (WebCore::IDBClient::IDBTransaction::IDBTransaction): Deleted.
1859         (WebCore::IDBClient::IDBTransaction::finishAbortOrCommit): Deleted.
1860         * Modules/indexeddb/client/IDBTransactionImpl.h:
1861         (WebCore::IDBClient::IDBTransaction::info):
1862         (WebCore::IDBClient::IDBTransaction::originalDatabaseInfo):
1863
1864         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1865         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1866         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1867         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1868         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
1869
1870         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1871         (WebCore::IDBTransactionInfo::versionChange):
1872         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
1873         (WebCore::IDBTransactionInfo::isolatedCopy):
1874         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1875         (WebCore::IDBTransactionInfo::originalDatabaseInfo):
1876
1877 2015-12-07  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1878
1879         Update Objective-C code generator to pass a reference to calling object for partial interfaces
1880         https://bugs.webkit.org/show_bug.cgi?id=151739
1881
1882         Reviewed by Darin Adler.
1883
1884         The fix updates the Objective-C code generator to pass a reference to calling object for partial interfaces.
1885         The change from pass by pointer to pass by reference was introduced in r192849.
1886
1887         * bindings/scripts/CodeGeneratorObjC.pm:
1888         (GenerateImplementation):
1889         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
1890         (-[DOMTestInterface supplementalStr1]):
1891         (-[DOMTestInterface supplementalStr2]):
1892         (-[DOMTestInterface setSupplementalStr2:]):
1893         (-[DOMTestInterface supplementalStr3]):
1894         (-[DOMTestInterface setSupplementalStr3:]):
1895         (-[DOMTestInterface supplementalNode]):
1896         (-[DOMTestInterface setSupplementalNode:]):
1897         (-[DOMTestInterface builtinAttribute]):
1898         (-[DOMTestInterface setBuiltinAttribute:]):
1899         (-[DOMTestInterface supplementalMethod1]):
1900         (-[DOMTestInterface supplementalMethod2:objArg:]):
1901         (-[DOMTestInterface supplementalMethod3]):
1902         (-[DOMTestInterface supplementalMethod4]):
1903         (-[DOMTestInterface builtinFunction]):
1904
1905 2015-12-07  Chris Dumez  <cdumez@apple.com>
1906
1907         Crash in MemoryCache::pruneDeadResourcesToSize()
1908         https://bugs.webkit.org/show_bug.cgi?id=151833
1909         <rdar://problem/22392235>
1910
1911         Reviewed by David Kilzer.
1912
1913         MemoryCache::pruneDeadResourcesToSize() is iterating over m_allResources
1914         (which is a vector of LRUList). It first destroys decoded data for each
1915         resource in the LRUList. Then, if it does not suffice to reach the
1916         target size, and starts actually removing resources from the cache.
1917
1918         The issue is that this code alters m_allResources (and its LRULists) as
1919         it is iterating over it. We tried to deal with this in various ways:
1920         1. Increment the iterator before removing the resource pointed by the
1921           iterator.
1922         2. Protect the next resource in the LRUList and abort early if it is no
1923           longer in the cache.
1924
1925         This adds code complexity and apparently does not correctly handle all
1926         the edge cases as we still see crashes in this code. In particular, I
1927         suspect that 2. may not be sufficient if it is possible for the next
1928         resource to be moved to another LRUList (in which case, next->inCache()
1929         would still return true but the iterator would however become invalid).
1930
1931         To make the code simpler and more robust, this patch copies the LRUList
1932         (and refs the CachedResources) before iterating over it. This is a lot
1933         safer and should hopefully fix the crashes we see in this function.
1934
1935         No new tests, no reproduction case.
1936
1937         * loader/cache/MemoryCache.cpp:
1938         (WebCore::MemoryCache::pruneDeadResourcesToSize):
1939
1940 2015-12-07  Brady Eidson  <beidson@apple.com>
1941
1942         Modern IDB: Add some more custom exception messages, passing some more tests..
1943         https://bugs.webkit.org/show_bug.cgi?id=151912
1944
1945         Reviewed by Andy Estes.
1946
1947         No new tests (Covered by existing tests).
1948
1949         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1950         (WebCore::IDBClient::IDBObjectStore::index):
1951         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1952         (WebCore::IDBClient::IDBTransaction::objectStore):
1953
1954 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1955
1956         [ThreadedCompositor] Add support for PlatformLayer.
1957         https://bugs.webkit.org/show_bug.cgi?id=143299
1958
1959         Reviewed by Žan Doberšek.
1960
1961         This patch implements TextureMapperPlatformLayerProxy and TextureMapperPlatformLayerBuffer to
1962         send a texture (actual texture or BitmapTexture) to the compositing thread directly.
1963         Platform layer renderers should implement TextureMapperPlatformLayerProxyProvider to establish
1964         a connection to the compositing thread. After the connection has been established, the renderer
1965         can render its contents to the TextureMapperPlatformLayerBuffer and pass it to the compositing thread
1966         via TextureMapperPlatformLayer proxy.
1967         The buffer can be an unmanaged texture (a.k.a. platform texture) or BitmapTexture.
1968         For the unmanaged texture, the renderer should manage its life cycle itself. For the BitmapTexture,
1969         it will be managed by TextureMapperPlatformLayerProxy. In that case, used (swapped) buffer will be
1970         recycled because the renderer will use same size and format until it changes its size.
1971
1972         No new tests needed.
1973
1974         * PlatformGTK.cmake:
1975         Adds TextureMapperPlatformLayerBuffer and TextureMapperPlaytformLayerProxy.
1976
1977         * platform/graphics/GraphicsContext3DPrivate.cpp:
1978         * platform/graphics/GraphicsContext3DPrivate.h:
1979         * platform/graphics/cairo/ImageBufferCairo.cpp:
1980         * platform/graphics/cairo/ImageBufferDataCairo.h:
1981         Adds mock implementation.
1982
1983         * platform/graphics/PlatformLayer.h:
1984         Adds TextureMapperPlatformLayerProxyProvider as a PlatformLayer for the Threaded Compositor
1985
1986         * platform/graphics/texmap/BitmapTextureGL.h:
1987         (WebCore::BitmapTextureGL::internalFormat): Adds a getter to check the
1988         internal format of texture to check reusability.
1989
1990         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1991         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1992         * platform/graphics/texmap/TextureMapperLayer.cpp:
1993         * platform/graphics/texmap/TextureMapperLayer.h:
1994         Exclude GraphicsLayerTextureMapper from build when we are using Coordinated Graphics.
1995
1996         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: Added.
1997         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: Added.
1998         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: Added.
1999         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: Added.
2000
2001         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2002         (WebCore::GraphicsLayer::create):
2003         Because we removed GraphicsLayerTextureMapper from build, we need to add own factory function.
2004
2005         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
2006         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
2007         (WebCore::CoordinatedGraphicsLayer::platformLayerWillBeDestroyed):
2008         (WebCore::CoordinatedGraphicsLayer::setPlatformLayerNeedsDisplay):
2009         Implements sync operations for TextureMapperPlatformLayerProxy
2010
2011 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
2012
2013         Fix GTK+ build with GStreamer GL
2014         https://bugs.webkit.org/show_bug.cgi?id=151939
2015
2016         Reviewed by Žan Doberšek.
2017
2018         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2019         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2020         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2021         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback):
2022         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2023
2024 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
2025
2026         Show more information about SVG renderers in showLayerTree() output
2027         https://bugs.webkit.org/show_bug.cgi?id=151930
2028
2029         Reviewed by Zalan Bujtas.
2030         
2031         In showLayerTree() output, for SVG renderers show:
2032         - visual and layout overflow, for boxes
2033         - frame rect, for boxes
2034         - layout state
2035         - class and id
2036
2037         * rendering/RenderLayer.cpp:
2038         (WebCore::showLayerTree):
2039         * rendering/RenderTreeAsText.cpp:
2040         (WebCore::RenderTreeAsText::writeRenderObject):
2041         (WebCore::writeDebugInfo): New function to share dumping with svg output.
2042         (WebCore::write):
2043         * rendering/RenderTreeAsText.h:
2044         * rendering/svg/SVGRenderTreeAsText.cpp:
2045         (WebCore::writePositionAndStyle): Show the frameRect for boxes (e.g. RenderSVGRoot).
2046         Much more useful that showing the clippedOverflowRect.
2047         (WebCore::writeStandardPrefix):
2048         (WebCore::writeChildren):
2049         (WebCore::writeSVGResourceContainer):
2050         (WebCore::writeSVGContainer):
2051         (WebCore::write):
2052         (WebCore::writeSVGText):
2053         (WebCore::writeSVGInlineText):
2054         (WebCore::writeSVGImage):
2055         (WebCore::writeSVGGradientStop):
2056         (WebCore::writeResources):
2057         (WebCore::operator<<): Deleted.
2058         * rendering/svg/SVGRenderTreeAsText.h:
2059
2060 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
2061
2062         Clipping along compositing borders in svg-edit
2063         https://bugs.webkit.org/show_bug.cgi?id=151791
2064
2065         Reviewed by Zalan Bujtas.
2066         
2067         RenderSVGRoot::layout() failed to clear overflow before recomputing
2068         visual overflow, which could cause it to get stuck with stale overflow.
2069         This would cause underpainting if its size went from small to large.
2070
2071         Test: svg/overflow/visual-overflow-change.html
2072
2073         * rendering/svg/RenderSVGRoot.cpp:
2074         (WebCore::RenderSVGRoot::layout):
2075
2076 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
2077
2078         REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
2079         https://bugs.webkit.org/show_bug.cgi?id=151849
2080         rdar://problem/23132828
2081
2082         Reviewed by Zalan Bujtas.
2083         
2084         This page uses a fill-forwards animation where the last keyframe has height: auto.
2085         After r187121, we tried to blend the height Length value from the last keyframe to the
2086         first keyframe with progress=0 (which should pick up the 'auto' from the last keyframe).
2087         
2088         However, Length::blend() just considered both 0 and 'auto' to be zero, and returned
2089         the 0 length.
2090         
2091         So fix Length::blend() to return the "from" length if progress is zero.
2092
2093         Test: animations/fill-forwards-auto-height.html
2094
2095         * page/animation/CSSPropertyAnimation.cpp:
2096         (WebCore::blendFunc): Length::blend takes a double, so don't narrow to float.
2097         * page/animation/KeyframeAnimation.cpp:
2098         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Declare two variables
2099         at first use.
2100         * platform/Length.h:
2101         (WebCore::Length::blend):
2102
2103 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
2104
2105         Give SVGTransformList some inline vector capacity
2106         https://bugs.webkit.org/show_bug.cgi?id=151644
2107
2108         Reviewed by Andreas Kling.
2109
2110         Giving SVGTransformList inline capacity of one drops time under SVGTransformList::parse() by
2111         about 1% on http://animateplus.com/demos/stress-test/
2112
2113         * svg/SVGTransformList.h:
2114
2115 2015-12-06  Zalan Bujtas  <zalan@apple.com>
2116
2117         Addressing post-review comments on r193374.
2118
2119         Reviewed by Antti Koivisto.
2120
2121         * rendering/SimpleLineLayout.cpp:
2122         (WebCore::SimpleLineLayout::canUseForText):
2123         (WebCore::SimpleLineLayout::canUseForFontAndText):
2124         (WebCore::SimpleLineLayout::canUseForStyle):
2125         (WebCore::SimpleLineLayout::canUseForWithReason):
2126         (WebCore::SimpleLineLayout::canUseFor):
2127         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
2128         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
2129
2130 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
2131
2132         Remove CORETEXT_WEB_FONTS
2133         https://bugs.webkit.org/show_bug.cgi?id=151891
2134
2135         Reviewed by Simon Fraser.
2136
2137         The only platform where this was turned off (Mavericks) is no longer supported.
2138
2139         No new tests because there is no behavior difference.
2140
2141         * platform/graphics/cocoa/FontCocoa.mm:
2142         (WebCore::Font::platformCreateScaledFont): Deleted.
2143         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2144         (WebCore::FontPlatformData::registeredFont):
2145         (WebCore::FontPlatformData::ctFont):
2146         * platform/graphics/mac/FontCustomPlatformData.cpp:
2147         (WebCore::FontCustomPlatformData::fontPlatformData): Deleted.
2148         (WebCore::createFontCustomPlatformData): Deleted.
2149         * platform/graphics/mac/FontCustomPlatformData.h:
2150         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Deleted.
2151         * platform/text/TextFlags.h:
2152
2153 2015-12-04  Zalan Bujtas  <zalan@apple.com>
2154
2155         Garbage in page tiles when document is too long.
2156         https://bugs.webkit.org/show_bug.cgi?id=151906
2157         rdar://problem/23695858
2158
2159         Reviewed by Simon Fraser.
2160
2161         This patch partially fixes the broken concept(webkit.org/b/151908) of having a nearlyMax/2 sized rectangle to define infiniteness.
2162         (see LayoutRect::infiniteRect() and ClipRect::isInfinite())
2163
2164         Covered by existing test.
2165
2166         * rendering/ClipRect.h: Branch for infinite clipping.
2167         (WebCore::ClipRect::intersect):
2168         (WebCore::ClipRect::intersects):
2169         * rendering/RenderLayer.cpp:
2170         (WebCore::RenderLayer::clipToRect): Do not clip when clipping is infinite.
2171         (WebCore::RenderLayer::restoreClip):
2172         (WebCore::RenderLayer::calculateClipRects):
2173
2174 2015-12-04  Brady Eidson  <beidson@apple.com>
2175
2176         Modern IDB: Add some more custom exception messages, passing some more tests.
2177         https://bugs.webkit.org/show_bug.cgi?id=151898
2178
2179         Reviewed by Alex Christensen.
2180
2181         No new tests (Some failing tests now pass).
2182
2183         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2184         (WebCore::IDBClient::IDBTransaction::objectStore):
2185
2186 2015-12-04  Brent Fulgham  <bfulgham@apple.com>
2187
2188         Place an upper bound on canvas pixel count
2189         https://bugs.webkit.org/show_bug.cgi?id=151825
2190         <rdar://problem/23324916>
2191
2192         Reviewed by Simon Fraser.
2193
2194         Malformed JavaScript can attempt to create lots of canvas contexts. Limit the amount of memory
2195         we will use for this purpose to some percentage of system RAM.
2196
2197         * html/HTMLCanvasElement.cpp:
2198         (WebCore::removeFromActivePixelMemory): Added helper function
2199         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Call new 'releaseImageBufferAndContext' method
2200         to ensure ImageBuffer and graphics context state are properly cleaned up.
2201         (WebCore::maxActivePixels): Use one quarter of the system RAM, or 1 GB (whichever is more) as
2202         an upper bound on active pixel memory.
2203         (WebCore::HTMLCanvasElement::getContext): If we are attempting to create a context that will cause
2204         us to exceed the allowed active pixel count, fail.
2205         (WebCore::HTMLCanvasElement::releaseImageBufferAndContext): Added helper function
2206         (WebCore::HTMLCanvasElement::setSurfaceSize): Use the new 'releaseImageBufferAndContext' method
2207         to handle active pixel memory counts.
2208         (WebCore::HTMLCanvasElement::createImageBuffer): Refuse to create a backing buffer if it will
2209         exceed our available pixel memory.
2210
2211 2015-12-04  Brady Eidson  <beidson@apple.com>
2212
2213         Modern IDB: Add some more custom exception messages, passing some more tests.
2214         https://bugs.webkit.org/show_bug.cgi?id=151895
2215
2216         Reviewed by Alex Christensen.
2217
2218         No new tests (Some failing tests now pass).
2219
2220         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2221         (WebCore::IDBClient::IDBDatabase::transaction):
2222
2223         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2224         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
2225
2226 2015-12-04  Jonathan Davis  <jond@apple.com>
2227
2228         Update feature status for up-to-date status information.
2229         https://bugs.webkit.org/show_bug.cgi?id=151821
2230
2231         Reviewed by Timothy Hatcher.
2232
2233         * features.json:
2234
2235 2015-12-04  Brady Eidson  <beidson@apple.com>
2236
2237         Modern IDB: Flip test expectations around so we only list failures.
2238         https://bugs.webkit.org/show_bug.cgi?id=151880
2239
2240         Reviewed by Alex Christensen.
2241
2242         No new tests (Covered by all existing tests).
2243
2244         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2245         (WebCore::IDBClient::IDBRequest::stop):
2246         (WebCore::IDBClient::IDBRequest::enqueueEvent):
2247         (WebCore::IDBClient::IDBRequest::dispatchEvent):
2248         * Modules/indexeddb/client/IDBRequestImpl.h:
2249         
2250         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2251         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
2252         (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
2253         (WebCore::IDBClient::IDBTransaction::stop):
2254         (WebCore::IDBClient::IDBTransaction::enqueueEvent):
2255         (WebCore::IDBClient::IDBTransaction::dispatchEvent):
2256         * Modules/indexeddb/client/IDBTransactionImpl.h:
2257         
2258         * bindings/js/IDBBindingUtilities.cpp:
2259         (WebCore::idbKeyToScriptValue): Protection against a ScriptExecutionContext that no longer has an ExecState.
2260           A full reworking on the binding utilities to prevent this through is covered by b/151890
2261
2262 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
2263
2264         [Cocoa] Some fonts cause CTFontCopyAvailableTables() to return nullptr
2265         https://bugs.webkit.org/show_bug.cgi?id=151884
2266         <rdar://problem/23752253>
2267
2268         Reviewed by Brian Burg.
2269
2270         No new tests.
2271
2272         * platform/graphics/opentype/OpenTypeCG.cpp:
2273         (WebCore::OpenType::fontHasMathTable):
2274
2275 2015-12-04  Jer Noble  <jer.noble@apple.com>
2276
2277         Unreviewed build-fix; Add new parameter to overloaded createSession() method in MediaPlayerPrivateAVFoundationCF.
2278
2279         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2280         (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
2281         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
2282         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2283         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
2284         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
2285
2286 2015-12-01  Jer Noble  <jer.noble@apple.com>
2287
2288         Adopt AVContentKeySession
2289         https://bugs.webkit.org/show_bug.cgi?id=151221
2290
2291         Reviewed by Eric Carlson.
2292
2293         Adopt a new API for managing key state, AVContentKeySession. Because this necessitates a change
2294         in both the initialization data returned by the needkey event, and passed into the createSession()
2295         method, bump the protocol version number (to 3), and keep supporting the old key management API
2296         for legacy content.
2297
2298         To do so, move most of the implementation of CDMPrivateMediaSourceAVFObjC into a new subclass,
2299         CDMSessionAVStreamSession, and add a new subclass, CDMSessionAVContentKeySession, to support the
2300         new API.
2301
2302         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
2303         (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Moved to implementation file.
2304         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2305         (WebCore::validKeySystemRE): Support "com.apple.fps.3_x".
2306         (WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Invalidate all outstanding sessions.
2307         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Only support "com.apple.fps.3_x" if the AVContentKeySession class is available.
2308         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Create an instance of CDMSessionAVContentKeySession if "com.apple.fps.3_x" is specified and AVContentKeySession is available.
2309         (WebCore::CDMPrivateMediaSourceAVFObjC::invalidateSession): Remove session from the list of outstanding sessions.
2310         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Deleted.
2311         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
2312         (WebCore::CDMSessionAVContentKeySession::hasContentKeySession): Simple accessor.
2313         (WebCore::toCDMSessionAVContentKeySession): Safe casting.
2314         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Added.
2315         (-[CDMSessionAVContentKeySessionDelegate initWithParent:]): Simple constructor.
2316         (-[CDMSessionAVContentKeySessionDelegate invalidate]): Remove reference to parent.
2317         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:willProvideKeyRequestInitializationDataForTrackID:]): Pass to parent.
2318         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:didProvideKeyRequestInitializationData:requestHandling:]): Ditto.
2319         (-[CDMSessionAVContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]): Ditto.
2320         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession): Create the delegate.
2321         (WebCore::CDMSessionAVContentKeySession::~CDMSessionAVContentKeySession): Invalidate the delegate and remove all parsers.
2322         (WebCore::CDMSessionAVContentKeySession::isAvailable): Return true if AVContentKeySession class is available.
2323         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest): Support "keyrelease" message, setting of the certificate, and creating key request object. 
2324         (WebCore::CDMSessionAVContentKeySession::releaseKeys): Retrieve keys from storage location.
2325         (WebCore::isEqual): Compares a Uint8Array to a char*.
2326         (WebCore::CDMSessionAVContentKeySession::update): Support "acknowledged" message, "renew" message, and key addition.
2327         (WebCore::CDMSessionAVContentKeySession::addParser): Add the parser to the AVContentKeySession.
2328         (WebCore::CDMSessionAVContentKeySession::removeParser): Remove parser from same.
2329         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): Retrieve key release message from AVContentKeySession.
2330         (WebCore::CDMSessionAVContentKeySession::didProvideContentKeyRequest): Simple setter.
2331         (WebCore::CDMSessionAVContentKeySession::contentKeySession): Lazily create the AVContentKeySession.
2332         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
2333         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2334         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
2335         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
2336         (WebCore::toCDMSessionAVStreamSession):
2337         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm.
2338         (-[CDMSessionAVStreamSessionObserver initWithParent:]): Moved from CDMSessionMediaSourceAVFObjcObserver.
2339         (-[CDMSessionAVStreamSessionObserver contentProtectionSessionIdentifierChanged:]): Ditto.
2340         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession): Ditto.
2341         (WebCore::CDMSessionAVStreamSession::~CDMSessionAVStreamSession): Ditto.
2342         (WebCore::CDMSessionAVStreamSession::generateKeyRequest): Ditto.
2343         (WebCore::CDMSessionAVStreamSession::releaseKeys): Ditto.
2344         (WebCore::isEqual): Ditto.
2345         (WebCore::CDMSessionAVStreamSession::update): Ditto.
2346         (WebCore::CDMSessionAVStreamSession::setStreamSession): Ditto.
2347         (WebCore::CDMSessionAVStreamSession::addParser): Ditto.
2348         (WebCore::CDMSessionAVStreamSession::removeParser): Ditto.
2349         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): Ditto.
2350         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2351         (WebCore::CDMSessionMediaSourceAVFObjC::invalidateCDM): Clear the m_cdm.
2352         (WebCore::toCDMSessionMediaSourceAVFObjC):
2353         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2354         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
2355         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Instruct our CDM to invalidate their references to us.
2356         (WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Call addParser().
2357         (WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Call removeParser().
2358         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Deleted.
2359         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Deleted.
2360         
2361         To give us a chance to create a CDMPrivate before we continue decoding media data, "block" further decoding
2362         on the background thread by creating a semaphore and passing it to the main thread, to be triggered when
2363         a CDM is created and attached to this source buffer.
2364
2365         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2366         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2367         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
2368         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
2369         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
2370         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2371         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2372         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): Deleted.
2373         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2374
2375         Drive-by fix: Only throw an error from keyRequestTimerFired() if the underlying call to
2376         generateKeyRequest() returned an error, rather than just failed to create a message.
2377
2378         * Modules/encryptedmedia/MediaKeySession.cpp:
2379         (WebCore::MediaKeySession::keyRequestTimerFired):
2380
2381         Drive-by fix: Pass the CDMSessionClient into CDM::createSession() so that it is immediately available
2382         in the CDMSessionPrivate constructor, rather than setting the client immediately after construction.
2383
2384         * Modules/encryptedmedia/CDM.cpp:
2385         (WebCore::CDM::createSession):
2386         * Modules/encryptedmedia/CDM.h:
2387         * Modules/encryptedmedia/CDMPrivate.h:
2388         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
2389         (WebCore::CDMPrivateClearKey::createSession):
2390         * Modules/encryptedmedia/CDMPrivateClearKey.h:
2391         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
2392         (WebCore::CDMPrivateMediaPlayer::createSession):
2393         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
2394         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2395         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
2396         * Modules/encryptedmedia/CDMSessionClearKey.h:
2397         * Modules/encryptedmedia/MediaKeySession.cpp:
2398         (WebCore::MediaKeySession::MediaKeySession):
2399         * platform/graphics/CDMSession.h:
2400         * platform/graphics/MediaPlayer.cpp:
2401         (WebCore::MediaPlayer::createSession):
2402         * platform/graphics/MediaPlayer.h:
2403         * platform/graphics/MediaPlayerPrivate.h:
2404         (WebCore::MediaPlayerPrivateInterface::createSession):
2405         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2406         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2407         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
2408         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2409         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession):
2410         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2411         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2412         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::keyNeeded): Deleted.
2413         * testing/MockCDM.cpp:
2414         (WebCore::MockCDM::createSession):
2415         (WebCore::MockCDMSession::MockCDMSession):
2416         * testing/MockCDM.h:
2417
2418         Add new files to the project:
2419
2420         * WebCore.xcodeproj/project.pbxproj:
2421
2422
2423 2015-12-04  Brady Eidson  <beidson@apple.com>
2424
2425         Modern IDB: storage/indexeddb/cursor-update.html fails.
2426         https://bugs.webkit.org/show_bug.cgi?id=151879
2427
2428         Reviewed by Oliver Hunt.
2429
2430         No new tests (At least one failing test now passes).
2431
2432         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2433         (WebCore::IDBClient::IDBRequest::IDBRequest):
2434
2435 2015-12-04  Brady Eidson  <beidson@apple.com>
2436
2437         Modern IDB: storage/indexeddb/version-change-exclusive.html fails
2438         https://bugs.webkit.org/show_bug.cgi?id=151870
2439
2440         Reviewed by Alex Christensen.
2441
2442         Test: storage/indexeddb/modern/double-open.html
2443               storage/indexeddb/version-change-exclusive.html
2444
2445         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2446         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Delay handling open operations
2447           while the first is still in progress.
2448         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
2449         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2450
2451 2015-12-04  Brady Eidson  <beidson@apple.com>
2452
2453         Modern IDB: storage/indexeddb/exceptions.html fails.
2454         https://bugs.webkit.org/show_bug.cgi?id=151732
2455
2456         Reviewed by Alex Christensen.
2457
2458         No new tests (At least one failing test now passes).
2459
2460         - Lots of customized exception messages for IDB code to match the text expectations.
2461         - Updates to the test expectations where we can't/won't match them exactly.
2462         - And a couple of little required behavior changes exposed by the test
2463
2464         * Modules/indexeddb/IDBCursor.h:
2465         * Modules/indexeddb/IDBCursor.idl:
2466         * Modules/indexeddb/IDBDatabase.h:
2467         * Modules/indexeddb/IDBDatabase.idl:
2468         * Modules/indexeddb/IDBDatabaseException.cpp:
2469         (WebCore::IDBDatabaseException::initializeDescription):
2470         * Modules/indexeddb/IDBFactory.h:
2471         * Modules/indexeddb/IDBFactory.idl:
2472         * Modules/indexeddb/IDBIndex.h:
2473         * Modules/indexeddb/IDBIndex.idl:
2474         * Modules/indexeddb/IDBObjectStore.h:
2475         * Modules/indexeddb/IDBObjectStore.idl:
2476         * Modules/indexeddb/IDBRequest.h:
2477         * Modules/indexeddb/IDBRequest.idl:
2478         * Modules/indexeddb/IDBTransaction.h:
2479         * Modules/indexeddb/IDBTransaction.idl:
2480         
2481         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2482         (WebCore::IDBClient::IDBCursor::update):
2483         (WebCore::IDBClient::IDBCursor::advance):
2484         (WebCore::IDBClient::IDBCursor::continueFunction):
2485         (WebCore::IDBClient::IDBCursor::deleteFunction):
2486         * Modules/indexeddb/client/IDBCursorImpl.h:
2487         
2488         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2489         (WebCore::IDBClient::IDBDatabase::createObjectStore):
2490         (WebCore::IDBClient::IDBDatabase::transaction):
2491         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
2492         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2493         
2494         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2495         (WebCore::IDBClient::IDBFactory::cmp):
2496         * Modules/indexeddb/client/IDBFactoryImpl.h:
2497         
2498         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2499         (WebCore::IDBClient::IDBIndex::openCursor):
2500         (WebCore::IDBClient::IDBIndex::count):
2501         (WebCore::IDBClient::IDBIndex::doCount):
2502         (WebCore::IDBClient::IDBIndex::openKeyCursor):
2503         (WebCore::IDBClient::IDBIndex::get):
2504         (WebCore::IDBClient::IDBIndex::doGet):
2505         (WebCore::IDBClient::IDBIndex::getKey):
2506         (WebCore::IDBClient::IDBIndex::doGetKey):
2507         * Modules/indexeddb/client/IDBIndexImpl.h:
2508         
2509         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2510         (WebCore::IDBClient::IDBObjectStore::openCursor):
2511         (WebCore::IDBClient::IDBObjectStore::get):
2512         (WebCore::IDBClient::IDBObjectStore::add):
2513         (WebCore::IDBClient::IDBObjectStore::put):
2514         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
2515         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
2516         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2517         (WebCore::IDBClient::IDBObjectStore::clear):
2518         (WebCore::IDBClient::IDBObjectStore::createIndex):
2519         (WebCore::IDBClient::IDBObjectStore::index):
2520         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
2521         (WebCore::IDBClient::IDBObjectStore::count):
2522         (WebCore::IDBClient::IDBObjectStore::doCount):
2523         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2524
2525         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2526         (WebCore::IDBClient::IDBRequest::result):
2527         (WebCore::IDBClient::IDBRequest::error):
2528         * Modules/indexeddb/client/IDBRequestImpl.h:
2529
2530         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2531         (WebCore::IDBClient::IDBTransaction::objectStore):
2532         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
2533         (WebCore::IDBClient::IDBTransaction::abort):
2534         * Modules/indexeddb/client/IDBTransactionImpl.h:
2535
2536         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2537         (WebCore::LegacyCursor::update):
2538         (WebCore::LegacyCursor::continueFunction):
2539         (WebCore::LegacyCursor::deleteFunction):
2540         * Modules/indexeddb/legacy/LegacyCursor.h:
2541
2542         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
2543         (WebCore::LegacyDatabase::createObjectStore):
2544         (WebCore::LegacyDatabase::deleteObjectStore):
2545         (WebCore::LegacyDatabase::transaction):
2546         (WebCore::LegacyDatabase::forceClose):
2547         * Modules/indexeddb/legacy/LegacyDatabase.h:
2548
2549         * Modules/indexeddb/legacy/LegacyFactory.cpp:
2550         (WebCore::LegacyFactory::cmp):
2551         * Modules/indexeddb/legacy/LegacyFactory.h:
2552
2553         * Modules/indexeddb/legacy/LegacyIndex.cpp:
2554         (WebCore::LegacyIndex::openCursor):
2555         (WebCore::LegacyIndex::count):
2556         (WebCore::LegacyIndex::openKeyCursor):
2557         (WebCore::LegacyIndex::get):
2558         (WebCore::LegacyIndex::getKey):
2559         * Modules/indexeddb/legacy/LegacyIndex.h:
2560
2561         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2562         (WebCore::LegacyObjectStore::get):
2563         (WebCore::LegacyObjectStore::add):
2564         (WebCore::LegacyObjectStore::put):
2565         (WebCore::LegacyObjectStore::deleteFunction):
2566         (WebCore::LegacyObjectStore::clear):
2567         (WebCore::LegacyObjectStore::createIndex):
2568         (WebCore::LegacyObjectStore::index):
2569         (WebCore::LegacyObjectStore::deleteIndex):
2570         (WebCore::LegacyObjectStore::openCursor):
2571         (WebCore::LegacyObjectStore::count):
2572         * Modules/indexeddb/legacy/LegacyObjectStore.h:
2573         (WebCore::LegacyObjectStore::createIndex):
2574         (WebCore::LegacyObjectStore::count):
2575
2576         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2577         (WebCore::LegacyRequest::result):
2578         (WebCore::LegacyRequest::error):
2579         (WebCore::LegacyRequest::dispatchEvent):
2580         (WebCore::LegacyRequest::uncaughtExceptionInEventHandler):
2581         * Modules/indexeddb/legacy/LegacyRequest.h:
2582
2583         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
2584         (WebCore::LegacyTransaction::objectStore):
2585         (WebCore::LegacyTransaction::abort):
2586         (WebCore::LegacyTransaction::stop):
2587         * Modules/indexeddb/legacy/LegacyTransaction.h:
2588
2589         * bindings/js/JSDOMBinding.cpp:
2590         (WebCore::createDOMException): For IDBDatabase exceptions, use createWithDescriptionAsMessage
2591
2592         * bindings/js/JSIDBDatabaseCustom.cpp:
2593         (WebCore::JSIDBDatabase::createObjectStore):
2594         (WebCore::JSIDBDatabase::transaction):
2595
2596         * bindings/js/JSIDBObjectStoreCustom.cpp:
2597         (WebCore::putOrAdd):
2598         (WebCore::JSIDBObjectStore::createIndex):
2599
2600         * dom/DOMCoreException.h:
2601         (WebCore::DOMCoreException::createWithDescriptionAsMessage): Create an exception whose message
2602           is the description.
2603         (WebCore::DOMCoreException::DOMCoreException):
2604
2605         * dom/ExceptionBase.cpp:
2606         (WebCore::ExceptionBase::ExceptionBase): Add a flag to determine where the message comes from
2607         * dom/ExceptionBase.h:
2608
2609         * dom/make_dom_exceptions.pl:
2610         (generateHeader): Add an IDBDatabaseException type
2611
2612         * inspector/InspectorIndexedDBAgent.cpp:
2613
2614 2015-12-04  Joseph Pecoraro  <pecoraro@apple.com>
2615
2616         Web Inspector: Remove untested and unused Worker inspection
2617         https://bugs.webkit.org/show_bug.cgi?id=151848
2618
2619         Reviewed by Brian Burg.
2620
2621         * CMakeLists.txt:
2622         * WebCore.vcxproj/WebCore.vcxproj:
2623         * WebCore.vcxproj/WebCore.vcxproj.filters:
2624         * WebCore.xcodeproj/project.pbxproj:
2625         * bindings/js/JSBindingsAllInOne.cpp:
2626         * bindings/js/WorkerScriptController.cpp:
2627         * bindings/js/WorkerScriptDebugServer.cpp: Removed.
2628         * bindings/js/WorkerScriptDebugServer.h: Removed.
2629         * inspector/InspectorAllInOne.cpp:
2630         * inspector/InspectorConsoleInstrumentation.h:
2631         (WebCore::InspectorInstrumentation::addMessageToConsole):
2632         * inspector/InspectorController.cpp:
2633         (WebCore::InspectorController::InspectorController): Deleted.
2634         * inspector/InspectorInstrumentation.cpp:
2635         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStartImpl): Deleted.
2636         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScopeImpl): Deleted.
2637         (WebCore::InspectorInstrumentation::willEvaluateWorkerScript): Deleted.
2638         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminatedImpl): Deleted.
2639         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
2640         (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): Deleted.
2641         * inspector/InspectorInstrumentation.h:
2642         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
2643         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart): Deleted.
2644         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScope): Deleted.
2645         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminated): Deleted.
2646         * inspector/InspectorTimelineAgent.h:
2647         * inspector/InspectorWebAgentBase.h:
2648         (WebCore::WorkerAgentContext::WorkerAgentContext): Deleted.
2649         * inspector/InspectorWorkerAgent.cpp: Removed.
2650         * inspector/InspectorWorkerAgent.h: Removed.
2651         * inspector/InspectorWorkerResource.h: Removed.
2652         * inspector/InstrumentingAgents.cpp:
2653         (WebCore::InstrumentingAgents::reset): Deleted.
2654         * inspector/InstrumentingAgents.h:
2655         (WebCore::InstrumentingAgents::workerRuntimeAgent): Deleted.
2656         (WebCore::InstrumentingAgents::setWorkerRuntimeAgent): Deleted.
2657         (WebCore::InstrumentingAgents::inspectorWorkerAgent): Deleted.
2658         (WebCore::InstrumentingAgents::setInspectorWorkerAgent): Deleted.
2659         * inspector/PageConsoleAgent.h:
2660         * inspector/PageScriptDebugServer.cpp:
2661         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
2662         * inspector/WorkerConsoleAgent.cpp: Removed.
2663         * inspector/WorkerConsoleAgent.h: Removed.
2664         * inspector/WorkerDebuggerAgent.cpp: Removed.
2665         * inspector/WorkerDebuggerAgent.h: Removed.
2666         * inspector/WorkerInspectorController.cpp: Removed.
2667         * inspector/WorkerInspectorController.h: Removed.
2668         * inspector/WorkerRuntimeAgent.cpp: Removed.
2669         * inspector/WorkerRuntimeAgent.h: Removed.
2670         * workers/Worker.cpp:
2671         (WebCore::Worker::notifyFinished): Deleted.
2672         * workers/WorkerGlobalScope.cpp:
2673         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Deleted.
2674         (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Deleted.
2675         * workers/WorkerGlobalScope.h:
2676         (WebCore::WorkerGlobalScope::workerInspectorController): Deleted.
2677         * workers/WorkerGlobalScopeProxy.h:
2678         (WebCore::WorkerGlobalScopeProxy::PageInspector::~PageInspector): Deleted.
2679         (WebCore::WorkerGlobalScopeProxy::connectToInspector): Deleted.
2680         (WebCore::WorkerGlobalScopeProxy::disconnectFromInspector): Deleted.
2681         (WebCore::WorkerGlobalScopeProxy::sendMessageToInspector): Deleted.
2682         * workers/WorkerMessagingProxy.cpp:
2683         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Deleted.
2684         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Deleted.
2685         (WebCore::WorkerMessagingProxy::connectToInspector): Deleted.
2686         (WebCore::WorkerMessagingProxy::disconnectFromInspector): Deleted.
2687         (WebCore::WorkerMessagingProxy::sendMessageToInspector): Deleted.
2688         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal): Deleted.
2689         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope): Deleted.
2690         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
2691         * workers/WorkerMessagingProxy.h:
2692         * workers/WorkerReportingProxy.h:
2693         * workers/WorkerThread.cpp:
2694         (WebCore::WorkerThread::workerThread): Deleted.
2695
2696 2015-12-03  Sergio Villar Senin  <svillar@igalia.com>
2697
2698         [css-grid] Fix height computation of grid items with borders inside fr tracks
2699         https://bugs.webkit.org/show_bug.cgi?id=151798
2700
2701         Reviewed by Zalan Bujtas.
2702
2703         Since r192154 we run a second pass of the track sizing
2704         algorithm whenever the height of the grid is indefinite in
2705         order to properly compute row sizes. The available space
2706         passed to the track sizing algorithm must not contain neither
2707         borders nor paddings, otherwise it will think that it has more
2708         space available than the existing one. We should use the
2709         height of the content box instead.
2710
2711         Test: fast/css-grid-layout/grid-item-with-border-in-fr.html
2712
2713         * rendering/RenderGrid.cpp:
2714         (WebCore::RenderGrid::layoutBlock):
2715
2716 2015-12-03  Brady Eidson  <beidson@apple.com>
2717
2718         Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
2719         https://bugs.webkit.org/show_bug.cgi?id=151847
2720
2721         Reviewed by Andy Estes.
2722
2723         No new tests (At least one failing test now passes).
2724
2725         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2726         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
2727         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2728
2729 2015-12-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2730
2731         Reduce uses of PassRefPtr in DOM - 1
2732         https://bugs.webkit.org/show_bug.cgi?id=149788
2733
2734         Reviewed by Darin Adler.
2735
2736         As a step to purge PassRefPtr, this patch reduces the uses in WebCore/dom.
2737
2738         * dom/ChildListMutationScope.cpp:
2739         (WebCore::ChildListMutationAccumulator::getOrCreate):
2740         * dom/ChildListMutationScope.h:
2741         * dom/ClipboardEvent.cpp:
2742         (WebCore::ClipboardEvent::ClipboardEvent):
2743         * dom/ClipboardEvent.h:
2744         * dom/CompositionEvent.cpp:
2745         (WebCore::CompositionEvent::CompositionEvent):
2746         (WebCore::CompositionEvent::initCompositionEvent):
2747         * dom/CompositionEvent.h:
2748         * dom/DOMNamedFlowCollection.cpp:
2749         (WebCore::DOMNamedFlowCollection::item):
2750         * dom/DOMNamedFlowCollection.h:
2751         * dom/DOMStringList.h:
2752         * dom/DeviceMotionController.cpp:
2753         (WebCore::DeviceMotionController::getLastEvent):
2754         * dom/DeviceMotionController.h:
2755         * dom/DeviceOrientationController.cpp:
2756         (WebCore::DeviceOrientationController::getLastEvent):
2757         * dom/DeviceOrientationController.h:
2758         * editing/Editor.cpp:
2759         (WebCore::Editor::dispatchCPPEvent):
2760         * page/DeviceController.h:
2761         (WebCore::DeviceController::getLastEvent):
2762
2763 2015-12-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2764
2765         Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
2766         https://bugs.webkit.org/show_bug.cgi?id=151829
2767
2768         Reviewed by Simon Fraser.
2769
2770         Set the CTM of the GraphicsContext to its original value before changing
2771         it. This is a lot cheaper than using GraphicsContextStateSaver to save the
2772         whole state of the GraphicsContext and restore it back;
2773
2774         * rendering/RenderLayer.cpp:
2775         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2776
2777 2015-12-03  Eric Carlson  <eric.carlson@apple.com>
2778
2779         [MediaStream] Update MediaStreamTrack.getCapabilities
2780         https://bugs.webkit.org/show_bug.cgi?id=151728
2781
2782         Reviewed by Jer Noble.
2783
2784         Test: fast/mediastream/MediaStreamTrack-getCapabilities.html
2785
2786         * CMakeLists.txt: Remove files deleted from the repository.
2787
2788         * DerivedSources.make: Ditto.
2789
2790         * Modules/mediastream/AllAudioCapabilities.h: Removed.
2791         * Modules/mediastream/AllAudioCapabilities.idl: Removed.
2792         * Modules/mediastream/AllVideoCapabilities.h: Removed.
2793         * Modules/mediastream/AllVideoCapabilities.idl: Removed.
2794         * Modules/mediastream/CapabilityRange.cpp: Removed.
2795         * Modules/mediastream/CapabilityRange.h: Removed.
2796         * Modules/mediastream/CapabilityRange.idl: Removed.
2797
2798         * Modules/mediastream/MediaSourceSettings.h:
2799         (WebCore::MediaSourceSettings::supportsVolume): Volume is a double.
2800         (WebCore::MediaSourceSettings::volume): Double.
2801
2802         * Modules/mediastream/MediaStreamCapabilities.cpp: Removed.
2803         * Modules/mediastream/MediaStreamCapabilities.h: Removed.
2804         * Modules/mediastream/MediaStreamCapabilities.idl: Removed.
2805
2806         * Modules/mediastream/MediaStreamTrack.cpp:
2807         (WebCore::MediaStreamTrack::getCapabilities): MediaStreamCapabilities is gone, return a RealtimeMediaSourceCapabilities.
2808         * Modules/mediastream/MediaStreamTrack.h:
2809         * Modules/mediastream/MediaStreamTrack.idl:
2810
2811         * WebCore.xcodeproj/project.pbxproj: Remove files deleted from the repository.
2812         * bindings/js/JSMediaStreamTrackCustom.cpp:
2813         (WebCore::capabilityValue):
2814         (WebCore::JSMediaStreamTrack::getCapabilities): Create and return a dictionary of capatilities.
2815
2816         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
2817         (WebCore::CapabilityValueOrRange::type):
2818         (WebCore::CapabilityValueOrRange::CapabilityValueOrRange):
2819         (WebCore::CapabilityValueOrRange::rangeMin):
2820         (WebCore::CapabilityValueOrRange::rangeMax):
2821         (WebCore::CapabilityValueOrRange::value):
2822         (WebCore::RealtimeMediaSourceCapabilities::create):
2823         (WebCore::RealtimeMediaSourceCapabilities::~RealtimeMediaSourceCapabilities):
2824         (WebCore::RealtimeMediaSourceCapabilities::supportsWidth):
2825         (WebCore::RealtimeMediaSourceCapabilities::width):
2826         (WebCore::RealtimeMediaSourceCapabilities::setWidth):
2827         (WebCore::RealtimeMediaSourceCapabilities::supportsHeight):
2828         (WebCore::RealtimeMediaSourceCapabilities::height):
2829         (WebCore::RealtimeMediaSourceCapabilities::setHeight):
2830         (WebCore::RealtimeMediaSourceCapabilities::supportsFrameRate):
2831         (WebCore::RealtimeMediaSourceCapabilities::frameRate):
2832         (WebCore::RealtimeMediaSourceCapabilities::setFrameRate):
2833         (WebCore::RealtimeMediaSourceCapabilities::supportsFacingMode):
2834         (WebCore::RealtimeMediaSourceCapabilities::facingMode):
2835         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode):
2836         (WebCore::RealtimeMediaSourceCapabilities::supportsAspectRatio):
2837         (WebCore::RealtimeMediaSourceCapabilities::aspectRatio):
2838         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatio):
2839         (WebCore::RealtimeMediaSourceCapabilities::supportsVolume):
2840         (WebCore::RealtimeMediaSourceCapabilities::volume):
2841         (WebCore::RealtimeMediaSourceCapabilities::setVolume):
2842         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleRate):
2843         (WebCore::RealtimeMediaSourceCapabilities::sampleRate):
2844         (WebCore::RealtimeMediaSourceCapabilities::setSampleRate):
2845         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleSize):
2846         (WebCore::RealtimeMediaSourceCapabilities::sampleSize):
2847         (WebCore::RealtimeMediaSourceCapabilities::setSampleSize):
2848         (WebCore::RealtimeMediaSourceCapabilities::supportsEchoCancellation):
2849         (WebCore::RealtimeMediaSourceCapabilities::echoCancellation):
2850         (WebCore::RealtimeMediaSourceCapabilities::setEchoCancellation):
2851         (WebCore::RealtimeMediaSourceCapabilities::supportsDeviceId):
2852         (WebCore::RealtimeMediaSourceCapabilities::deviceId):
2853         (WebCore::RealtimeMediaSourceCapabilities::setDeviceId):
2854         (WebCore::RealtimeMediaSourceCapabilities::supportsGroupId):
2855         (WebCore::RealtimeMediaSourceCapabilities::groupId):
2856         (WebCore::RealtimeMediaSourceCapabilities::setGroupId):
2857         (WebCore::RealtimeMediaSourceCapabilities::RealtimeMediaSourceCapabilities):
2858         (WebCore::RealtimeMediaSourceCapabilityRange::RealtimeMediaSourceCapabilityRange): Deleted.
2859         (WebCore::RealtimeMediaSourceCapabilityRange::min): Deleted.
2860         (WebCore::RealtimeMediaSourceCapabilityRange::max): Deleted.
2861         (WebCore::RealtimeMediaSourceCapabilityRange::type): Deleted.
2862         (WebCore::RealtimeMediaSourceCapabilityRange::supported): Deleted.
2863         (WebCore::RealtimeMediaSourceCapabilities::sourceId): Deleted.
2864         (WebCore::RealtimeMediaSourceCapabilities::setSourceId): Deleted.
2865         (WebCore::RealtimeMediaSourceCapabilities::facingModes): Deleted.
2866         (WebCore::RealtimeMediaSourceCapabilities::setWidthRange): Deleted.
2867         (WebCore::RealtimeMediaSourceCapabilities::setHeightRange): Deleted.
2868         (WebCore::RealtimeMediaSourceCapabilities::setFrameRateRange): Deleted.
2869         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatioRange): Deleted.
2870         (WebCore::RealtimeMediaSourceCapabilities::setVolumeRange): Deleted.
2871         (WebCore::RealtimeMediaSourceCapabilities::hasVideoSource): Deleted.
2872         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource): Deleted.
2873
2874         * platform/mediastream/RealtimeMediaSourceSettings.h:
2875         (WebCore::RealtimeMediaSourceSettings::volume): Volume is a double.
2876         (WebCore::RealtimeMediaSourceSettings::setVolume): Ditt.
2877
2878         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2879         (WebCore::AVAudioCaptureSource::initializeCapabilities): Initialize volume capability.
2880
2881         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2882         (WebCore::AVMediaCaptureSource::capabilities): RealtimeMediaSourceCapabilities constructor takes
2883           supportedConstraints. sourceId -> deviceId.
2884
2885         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2886         (WebCore::AVVideoCaptureSource::initializeCapabilities): DeviceId is set by the base class.
2887
2888         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: Drive-by cleanup, remove unused code.
2889
2890         * platform/mock/MockRealtimeAudioSource.cpp:
2891         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Updated.
2892         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Ditto.
2893
2894         * platform/mock/MockRealtimeMediaSource.cpp:
2895         (WebCore::MockRealtimeMediaSource::capabilities): sourceId -> deviceId.
2896
2897         * platform/mock/MockRealtimeVideoSource.cpp:
2898         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Updated.
2899         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
2900
2901 2015-12-03  Simon Fraser  <simon.fraser@apple.com>
2902
2903         Have layer memory use consult the backing store format
2904         https://bugs.webkit.org/show_bug.cgi?id=151827
2905         rdar://problem/23746497
2906
2907         Reviewed by Dean Jackson.
2908         
2909         When computing the backing store memory size, take the pixel format into account,
2910         rather than assuming 4 bytes per pixel.
2911
2912         * platform/graphics/ca/GraphicsLayerCA.cpp:
2913         * platform/graphics/ca/PlatformCALayer.h:
2914
2915 2015-12-03  Anders Carlsson  <andersca@apple.com>
2916
2917         Remove Objective-C GC support
2918         https://bugs.webkit.org/show_bug.cgi?id=151819
2919         rdar://problem/23746991
2920
2921         Reviewed by Dan Bernstein.
2922
2923         * Configurations/Base.xcconfig:
2924         * bindings/objc/WebScriptObject.mm:
2925         (+[WebScriptObject initialize]): Deleted.
2926         (-[WebScriptObject finalize]): Deleted.
2927         * bindings/scripts/CodeGeneratorObjC.pm:
2928         (GenerateImplementation):
2929         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm:
2930         (-[DOMTestActiveDOMObject finalize]): Deleted.
2931         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
2932         (-[DOMTestCallback finalize]): Deleted.
2933         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm:
2934         (-[DOMTestCallbackFunction finalize]): Deleted.
2935         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm:
2936         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]): Deleted.
2937         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm:
2938         (-[DOMTestCustomNamedGetter finalize]): Deleted.
2939         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
2940         (-[DOMTestEventConstructor finalize]): Deleted.
2941         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm:
2942         (-[DOMTestEventTarget finalize]): Deleted.
2943         * bindings/scripts/test/ObjC/DOMTestException.mm:
2944         (-[DOMTestException finalize]): Deleted.
2945         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm:
2946         (-[DOMTestGenerateIsReachable finalize]): Deleted.
2947         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
2948         (-[DOMTestInterface finalize]): Deleted.
2949         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm:
2950         (-[DOMTestJSBuiltinConstructor finalize]): Deleted.
2951         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm:
2952         (-[DOMTestMediaQueryListListener finalize]): Deleted.
2953         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm:
2954         (-[DOMTestNamedConstructor finalize]): Deleted.
2955         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm:
2956         (-[DOMTestNondeterministic finalize]): Deleted.
2957         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2958         (-[DOMTestObj finalize]): Deleted.
2959         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm:
2960         (-[DOMTestOverloadedConstructors finalize]): Deleted.
2961         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm:
2962         (-[DOMTestOverrideBuiltins finalize]): Deleted.
2963         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
2964         (-[DOMTestSerializedScriptValueInterface finalize]): Deleted.
2965         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
2966         (-[DOMTestTypedefs finalize]): Deleted.
2967         * bindings/scripts/test/ObjC/DOMattribute.mm:
2968         (-[DOMattribute finalize]): Deleted.
2969         * bindings/scripts/test/ObjC/DOMreadonly.mm:
2970         (-[DOMreadonly finalize]): Deleted.
2971         * bridge/objc/objc_instance.mm:
2972         (ObjcInstance::virtualBegin):
2973         (allocateAutoReleasePool): Deleted.
2974         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2975         * platform/mac/SharedBufferMac.mm:
2976         (+[WebCoreSharedBufferData initialize]): Deleted.
2977         (-[WebCoreSharedBufferData finalize]): Deleted.
2978         * platform/mac/WebCoreObjCExtras.h:
2979         (WebCoreObjCFinalizeOnMainThread): Deleted.
2980
2981 2015-12-03  Zalan Bujtas  <zalan@apple.com>
2982
2983         Simple line layout: Print out simple line layout statistics for the current page from command line.
2984         https://bugs.webkit.org/show_bug.cgi?id=151806
2985
2986         Reviewed Simon Fraser.
2987
2988         com.apple.WebKit.showSimpleLineLayoutCoverage prints out a coverage summary of the current page,
2989         while com.apple.WebKit.showSimpleLineLayoutReasons lists the non-simple line layout blocks including the reasons why
2990         they are not covered.
2991
2992         No change in functionality.
2993
2994         * rendering/SimpleLineLayout.cpp:
2995         (WebCore::SimpleLineLayout::canUseForText):
2996         (WebCore::SimpleLineLayout::canUseForFontAndText):
2997         (WebCore::SimpleLineLayout::canUseForStyle):
2998         (WebCore::SimpleLineLayout::canUseForWithReason):
2999         (WebCore::SimpleLineLayout::canUseFor):
3000         (WebCore::SimpleLineLayout::printReason):
3001         (WebCore::SimpleLineLayout::printReasons):
3002         (WebCore::SimpleLineLayout::printTextForSubtree):
3003         (WebCore::SimpleLineLayout::textLengthForSubtree):
3004         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
3005         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
3006         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
3007         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
3008
3009 2015-12-03  Jonathan Davis  <jond@apple.com>
3010
3011         Add WebCrypto to status page
3012         https://bugs.webkit.org/show_bug.cgi?id=151760
3013
3014         Reviewed by Timothy Hatcher.
3015
3016         * features.json:
3017
3018 2015-12-03  Keith Rollin  <krollin@apple.com>
3019
3020         [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
3021         https://bugs.webkit.org/show_bug.cgi?id=150909
3022         rdar://problem/23539673
3023
3024         Reviewed by Darin Adler.
3025
3026         When returning text to be displayed, an <option> element will return
3027         the value of a label attribute if it exists, or the text content as a
3028         fallback. The failing test concerned the display of a <select>
3029         element when it contained a sole <option> element that had a label
3030         attribute set to a single space. When displayed, various
3031         platform-specific bits of code will strip off the leading and trailing
3032         whitespace. However, when WebKit would use this text to measure how
3033         wide the <select> popup menu button should be, it would not strip off
3034         spaces, leading to the calculated width being wider than necessary.
3035         The approach taken to fix this is to strip whitespace in the label
3036         attribute before it is returned from the <option> element.
3037
3038         No new tests. fast/forms/HTMLOptionElement_label03.html had been
3039         marked as being expected to fail in TestExpectations; that test now
3040         succeeds.
3041
3042         * html/HTMLOptionElement.cpp:
3043         (WebCore::HTMLOptionElement::label):
3044
3045 2015-12-03  Sam Weinig  <sam@webkit.org>
3046
3047         Try to fix the Windows build.
3048
3049         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3050         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
3051         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
3052
3053 2015-12-03  Brady Eidson  <beidson@apple.com>
3054
3055         Modern IDB: storage/indexeddb/cursor-advance.html fails.
3056         https://bugs.webkit.org/show_bug.cgi?id=151731
3057
3058         Reviewed by Alex Christensen.
3059
3060         No new tests (At least one failing test now passes).
3061
3062         * Modules/indexeddb/IDBCursor.h:
3063         * Modules/indexeddb/IDBCursor.idl:
3064         
3065         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3066         (WebCore::IDBClient::IDBCursor::advance): Return a custom exception message for TypeError.
3067         * Modules/indexeddb/client/IDBCursorImpl.h:
3068         
3069         * Modules/indexeddb/legacy/LegacyCursor.cpp:
3070         (WebCore::LegacyCursor::advance):
3071         * Modules/indexeddb/legacy/LegacyCursor.h:
3072         
3073         * bindings/js/JSDOMBinding.cpp:
3074         (WebCore::createDOMException):
3075         (WebCore::setDOMException):
3076         * bindings/js/JSDOMBinding.h:
3077         
3078         * bindings/scripts/IDLAttributes.txt:
3079         
3080         * inspector/InspectorIndexedDBAgent.cpp:
3081
3082 2015-12-03  Brent Fulgham  <bfulgham@apple.com>
3083
3084         Allow JavaScript to iterate over plugins for local files
3085         https://bugs.webkit.org/show_bug.cgi?id=151783
3086         <rdar://problem/23692113>
3087
3088         Reviewed by Alexey Proskuryakov.
3089
3090         Test: http/tests/plugins/plugin-javascript-access.html
3091               plugins/plugin-javascript-access.html
3092
3093         * page/Page.cpp:
3094         (WebCore::Page::showAllPlugins): True if we set the debugging flag to show
3095         all plugins, or if the document's origin is from a local file.
3096         * page/Page.h:
3097
3098 2015-12-03  Jer Noble  <jer.noble@apple.com>
3099
3100         Unreviewed build-fix; missing include.
3101
3102         * html/HTMLVideoElement.cpp:
3103
3104 2015-12-03  Brady Eidson  <beidson@apple.com>
3105
3106         Modern IDB: storage/indexeddb/cursor-skip-deleted.html crashes.
3107         https://bugs.webkit.org/show_bug.cgi?id=151794
3108
3109         Reviewed by Alex Christensen.
3110
3111         STL reverse_iterators are a tricky beast.
3112         
3113         They are implemented in terms of a normal forward iterator (called the "base" iterator),
3114         and they decrement a copy of that iterator when dereferenced.
3115             
3116         So when monitoring deletes from  a std::set to check if we should invalidate our current 
3117         reverse_iterator, we were incorrectly comparing the deleted key to the value pointed by the
3118         reverse_iterator instead of its base iterator.
3119         
3120         Since the iterators in question are bidirectional, anyways, we can just use a single iterator
3121         and either increment or decrement it as needed.
3122         
3123         No new tests (At least one failing (crashing) test now passes).
3124
3125         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
3126         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
3127         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
3128         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
3129         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
3130         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
3131         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
3132         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
3133         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
3134         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
3135         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
3136         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): Deleted.
3137         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): Deleted.
3138         (WebCore::IDBServer::MemoryObjectStoreCursor::hasIterators): Deleted.
3139         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): Deleted.
3140         (WebCore::IDBServer::MemoryObjectStoreCursor::clearIterators): Deleted.
3141         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
3142
3143 2015-12-03  Per Arne Vollan  <peavo@outlook.com>
3144
3145         [WinCairo][MediaFoundation] Main thread can block when session is destroyed.
3146         https://bugs.webkit.org/show_bug.cgi?id=151803
3147
3148         Reviewed by Alex Christensen.
3149
3150         Set flag to make sure that the scheduler thread stops when the session ends.
3151
3152         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3153         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
3154         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
3155         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
3156         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3157         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopThread):
3158
3159 2015-12-03  Jer Noble  <jer.noble@apple.com>
3160
3161         [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
3162         https://bugs.webkit.org/show_bug.cgi?id=150906
3163
3164         Reviewed by Simon Fraser.
3165
3166         When restoring the user interface when exiting PiP, we should return to Fullscreen if that
3167         is where fullscreen was initiated from. Additionally, when we "auto-PiP" by backgrounding the
3168         app in Fullscreen mode, we should "auto-un-PiP" when restoring the application to foreground.
3169
3170         Rather than have a separate method to request exiting fullscreen, entering standard fullscreen,
3171         and switching to & from PiP, add a new method setFullscreenMode() which does all three.
3172
3173         * html/HTMLVideoElement.cpp:
3174         (WebCore::presentationModeToFullscreenMode):
3175         (WebCore::HTMLVideoElement::webkitSetPresentationMode):
3176         (WebCore::HTMLVideoElement::setFullscreenMode):
3177         * html/HTMLVideoElement.h:
3178
3179         Add methods to for clients to request a specific fullscreen mode, and to query whether
3180         the page is currently visible.
3181
3182         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3183         (WebVideoFullscreenControllerContext::requestFullscreenMode):
3184         (WebVideoFullscreenControllerContext::isVisible):
3185         (WebVideoFullscreenControllerContext::requestExitFullscreen): Deleted.
3186         * platform/ios/WebVideoFullscreenModel.h:
3187         * platform/ios/WebVideoFullscreenModelVideoElement.h:
3188         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3189         (WebVideoFullscreenModelVideoElement::requestFullscreenMode):
3190         (WebVideoFullscreenModelVideoElement::isVisible):
3191         (WebVideoFullscreenModelVideoElement::requestExitFullscreen): Deleted.
3192
3193         Track whether returning from PiP should enter fullscreen, or whether foregrounding the app
3194         should cause PiP to return to fullscreen.
3195
3196         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3197         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3198         (-[WebAVPlayerLayer layoutSublayers]): Renamed from -setBounds:. -layoutSublayers is called
3199             more consistently than -setBounds:, including when a sublayer is added to the layer.
3200         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): The PiP WebAVPlayerLayer's
3201             modelVideoLayerFrame property may have been modified, so pass it back up to the fullscreen
3202             layer when exiting PiP.
3203         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Request fullscreen if we auto-PiPed.
3204         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Only recreate owned objects if they did not already exist.
3205         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): If we are in PiP mode, enter fullscreen by stopping PiP.
3206         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): requestExitFullscreen() -> requestFullscreenMode().
3207         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Animate out the fullscreen window, if exiting Fullscreen -> PiP.
3208         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Set m_shouldReturnToFullscreenAfterEnteringForeground if we auto-PiPed.
3209         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): requestExitFullscreen() -> requestFullscreenMode().
3210         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): If we are returning from PiP -> Fullscreen, do not hide the fullscreen window.
3211         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): If we are returning from PiP -> Fullscreen, show the controls and notify clients.
3212         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Animate in the fullscreen window, if returning from PiP -> Fullscreen.
3213         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Set m_shouldReturnToFullscreenWhenStoppingPiP if we are entering PiP from Fullscreen.
3214         * platform/spi/cocoa/AVKitSPI.h:
3215
3216 2015-12-02  Sam Weinig  <sam@webkit.org>
3217
3218         Promise callbacks should be called at microtask checkpoints
3219         https://bugs.webkit.org/show_bug.cgi?id=147933
3220
3221         Reviewed by Chris Dumez.
3222
3223         - Re-names MicroTaskQueue and MicroTask to MicrotaskQueue and Microtask to match the spec language.
3224         - Re-implements MicrotaskQueue and Microtask support suspended Microtasks (via the new KeepInQueue
3225           result value a Microtask can have when running) and correct behavior when Microtasks are added to
3226           the queue during a Microtask checkpoint.
3227         - MicrotaskQueue now has a mainThreadQueue() static function, replacing the old singleton() function,
3228           which can be used for the Document (non-Worker) Microtasks. For Workers, the a MicrotaskQueue 
3229           can be separately allocated for each WorkerGlobalScope (though this was not done in this change).
3230         - Adds a helper subclass of Microtask, ActiveDOMCallbackMicrotask, for Microtasks that are
3231           per-ScriptExecutationContext, and need to act as ActiveDOMCallbacks.
3232         - Re-implement Document (non-Worker) Promises on top of ActiveDOMCallbackMicrotask.
3233         - Re-implement MutationObserver delivery on top of Microtask.
3234
3235         Layout Test:
3236             fast/dom/microtask-promise-mutation-observer-order.html
3237
3238         * CMakeLists.txt:
3239         * WebCore.vcxproj/WebCore.vcxproj:
3240         * WebCore.xcodeproj/project.pbxproj:
3241         * dom/DOMAllInOne.cpp:
3242         Add new files.
3243
3244         * bindings/js/JSDOMWindowBase.cpp:
3245         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
3246         Switch to using ActiveDOMCallbackMicrotask/MicrotaskQueue rather than ScriptExecutionContext's Task mechanism
3247         for JavaScriptCore tasks.
3248
3249         * bindings/js/JSMainThreadExecState.cpp:
3250         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
3251         Perform a microtask checkpoint rather than calling MutationObserver code explicitly now that mutation observers
3252         use microtasks.
3253
3254         * dom/ActiveDOMCallbackMicrotask.cpp: Added.
3255         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
3256         (WebCore::ActiveDOMCallbackMicrotask::~ActiveDOMCallbackMicrotask):
3257         (WebCore::ActiveDOMCallbackMicrotask::run):
3258         (WebCore::ActiveDOMCallbackMicrotask::contextDestroyed):
3259         * dom/ActiveDOMCallbackMicrotask.h: Added.
3260         Add a helper subclass of Microtask which behaves like a ActiveDOMCallback (e.g. supports suspension
3261         and context destruction).
3262
3263         * dom/MicroTask.cpp: Renamed to Microtasks.cpp.
3264         * dom/MicroTask.h: Renamed to Microtasks.h.
3265         * dom/Microtasks.cpp: Renamed from Source/WebCore/dom/MicroTask.cpp.
3266         (WebCore::Microtask::removeSelfFromQueue):
3267         (WebCore::MicrotaskQueue::mainThreadQueue):
3268         (WebCore::MicrotaskQueue::append):
3269         (WebCore::MicrotaskQueue::remove):
3270         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
3271         (WebCore::MicroTaskQueue::singleton): Deleted.
3272         (WebCore::MicroTaskQueue::queueMicroTask): Deleted.
3273         (WebCore::MicroTaskQueue::runMicroTasks): Deleted.
3274         * dom/Microtasks.h: Renamed from Source/WebCore/dom/MicroTask.h.
3275         (WebCore::Microtask::~Microtask):
3276         (WebCore::MicrotaskQueue::MicrotaskQueue):
3277         (WebCore::MicrotaskQueue::~MicrotaskQueue):
3278         (WebCore::MicroTask::~MicroTask): Deleted.
3279         (WebCore::MicroTaskQueue::~MicroTaskQueue): Deleted.
3280         (WebCore::MicroTaskQueue::MicroTaskQueue): Deleted.
3281         Re-implement MicrotaskQueue and Microtask to support Microtask suspension (via the KeepInQueue result
3282         value) and correct behavior when Microtasks are queued during checkpoints.
3283
3284         * dom/MutationObserver.cpp:
3285         (WebCore::suspendedMutationObservers):
3286         (WebCore::MutationObserverMicrotask::MutationObserverMicrotask):
3287         (WebCore::MutationObserverMicrotask::~MutationObserverMicrotask):
3288         (WebCore::MutationObserverMicrotask::run):
3289         (WebCore::queueMutationObserverCompoundMicrotask):
3290         (WebCore::MutationObserver::enqueueMutationRecord):
3291         (WebCore::MutationObserver::setHasTransientRegistration):
3292         * dom/MutationObserver.h:
3293         Re-implement MutationObserver delivery on top of Microtasks.
3294
3295         * dom/ScriptRunner.cpp:
3296         (WebCore::ScriptRunner::timerFired):
3297         Remove unnecessary call to runMicroTasks().
3298
3299         * html/parser/HTMLScriptRunner.cpp:
3300         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
3301         (WebCore::HTMLScriptRunner::runScript):
3302         Remove calls to MutationObserver::deliverAllMutations() now that the MicrotaskQueue will take care of it.
3303
3304         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
3305         Remove unnecessary call to runMicroTasks().
3306
3307         * testing/Internals.cpp:
3308         (WebCore::Internals::queueMicroTask):
3309         Use ActiveDOMCallbackMicrotask rather than a custom test subclass.
3310
3311         * testing/MicroTaskTest.cpp: Removed.
3312         * testing/MicroTaskTest.h: Removed.
3313         Remove custom test subclass of Microtask, just use ActiveDOMCallbackMicrotask directly.
3314
3315 2015-12-03  Brady Eidson  <beidson@apple.com>
3316
3317         Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
3318         https://bugs.webkit.org/show_bug.cgi?id=151807
3319
3320         Reviewed by Alex Christensen.
3321
3322         No new tests (Covered by changes to existing bindings tests).
3323
3324         While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
3325         two separate variables to reduce complexity.
3326         
3327         * bindings/scripts/CodeGeneratorJS.pm:
3328         (GenerateImplementation):
3329         (GenerateImplementationFunctionCall):
3330         (GenerateConstructorDefinition):
3331         (GenerateParametersCheck): Deleted.
3332         (GenerateReturnParameters): Deleted.
3333         
3334         * bindings/scripts/IDLAttributes.txt:
3335         
3336         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3337         (webkit_dom_test_obj_set_property):
3338         (webkit_dom_test_obj_get_property):
3339         (webkit_dom_test_obj_class_init):
3340         (webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
3341         (webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
3342         (webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
3343         (webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
3344         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3345         
3346         * bindings/scripts/test/JS/JSTestObj.cpp:
3347         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
3348         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
3349         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
3350         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
3351         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
3352         * bindings/scripts/test/ObjC/DOMTestObj.h:
3353         
3354         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3355         (-[DOMTestObj attrWithGetterExceptionWithMessage]):
3356         (-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
3357         (-[DOMTestObj attrWithSetterExceptionWithMessage]):
3358         (-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
3359         
3360         * bindings/scripts/test/TestObj.idl:
3361         
3362         * dom/ExceptionCode.h:
3363
3364 2015-12-03  Javier Fernandez  <jfernandez@igalia.com>
3365
3366         [css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
3367         https://bugs.webkit.org/show_bug.cgi?id=151802
3368
3369         Reviewed by Sergio Villar Senin.
3370
3371         When resolving auto margins so that they use the available space, in the
3372         corresponding axis, we must consider that there might be other specified
3373         margins. Such margins must account to determine the actual available space.
3374
3375         Test: fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html
3376
3377         * rendering/RenderGrid.cpp:
3378         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
3379         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
3380
3381 2015-12-02  Antti Koivisto  <antti@apple.com>
3382
3383         Move ResourceLoadScheduler to WebKit1
3384         https://bugs.webkit.org/show_bug.cgi?id=151743
3385
3386         Reviewed by Alex Christensen.
3387
3388         It is no longer used by WebKit2. Simplify the WebKit/WebCore interface.
3389
3390         * WebCore.xcodeproj/project.pbxproj:
3391         * dom/ContainerNode.cpp:
3392         * dom/Document.cpp:
3393         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
3394         * dom/Document.h:
3395         * loader/DocumentLoader.h:
3396         * loader/LoaderStrategy.cpp:
3397         (WebCore::LoaderStrategy::~LoaderStrategy):
3398         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender):
3399         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender):
3400         (WebCore::LoaderStrategy::resourceLoadScheduler): Deleted.
3401         (WebCore::LoaderStrategy::loadResourceSynchronously): Deleted.
3402         (WebCore::LoaderStrategy::createBlobRegistry): Deleted.
3403         (WebCore::LoaderStrategy::createPingHandle): Deleted.
3404         * loader/LoaderStrategy.h:
3405
3406             Loading functions implemented on WebKit side move to pure virtual LoaderStrategy.
3407
3408         * loader/ResourceLoadScheduler.cpp: Removed.
3409         * loader/ResourceLoadScheduler.h: Removed.
3410
3411             ResourceLoadScheduler moves to WebKit1 as WebResourceLoadScheduler.
3412
3413         * loader/ResourceLoader.cpp:
3414         (WebCore::ResourceLoader::finishNetworkLoad):
3415         (WebCore::ResourceLoader::setDefersLoading):
3416         (WebCore::ResourceLoader::frameLoader):
3417         (WebCore::ResourceLoader::willSwitchToSubstituteResource):
3418         (WebCore::ResourceLoader::willSendRequestInternal):
3419         * loader/archive/ArchiveResourceCollection.h:
3420         * loader/cache/CachedResource.cpp:
3421         (WebCore::CachedResource::load):
3422         * loader/cache/CachedResourceLoader.cpp:
3423         (WebCore::CachedResourceLoader::performPostLoadActions):
3424         (WebCore::CachedResourceLoader::incrementRequestCount):
3425         * platform/PlatformStrategies.h:
3426         (WebCore::PlatformStrategies::pluginStrategy):
3427         (WebCore::PlatformStrategies::blobRegistry):
3428
3429             Move BlobRegistry factory function here from LoaderStrategy as this allows network process to have null loaderStrategy.
3430             (it could be renamed BlobStrategy for consistency later).
3431
3432         (WebCore::PlatformStrategies::PlatformStrategies):
3433         * platform/network/BlobRegistry.cpp:
3434         (WebCore::blobRegistry):
3435         (WebCore::BlobRegistry::~BlobRegistry):
3436         * platform/network/ResourceRequestBase.h:
3437         * style/StyleResolveTree.cpp:
3438         (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
3439         (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
3440
3441 2015-12-02  Myles C. Maxfield  <mmaxfield@apple.com>
3442
3443         Unify font-variant-* with font-variant shorthand
3444         https://bugs.webkit.org/show_bug.cgi?id=149773
3445
3446         Reviewed by Darin Adler.
3447
3448         This patch makes font-variant a shorthand for the following properties:
3449         font-variant-ligatures
3450         font-variant-position
3451         font-variant-caps
3452         font-variant-numeric
3453         font-variant-alternates
3454         font-variant-east-asian
3455
3456         This is consistent with the CSS Fonts Level 3 spec.
3457
3458         This patch also migrates the "font" longhand to use the font-variant-caps
3459         property.
3460
3461         Test: fast/text/font-variant-shorthand.html
3462
3463         * css/CSSComputedStyleDeclaration.cpp:
3464         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
3465         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
3466         font-variant computed style.
3467         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
3468         the font shorthand.
3469         * css/CSSFontSelector.cpp:
3470         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
3471         of the new shorthand property).
3472         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
3473         (WebCore::CSSParser::parseValue):
3474         (WebCore::CSSParser::parseFont):
3475         (WebCore::CSSParser::parseSystemFont):
3476         (WebCore::CSSParser::parseFontVariantLigatures):
3477         (WebCore::CSSParser::parseFontVariantNumeric):
3478         (WebCore::CSSParser::parseFontVariantEastAsian):
3479         (WebCore::CSSParser::parseFontVariant):
3480         (WebCore::isValidKeywordPropertyAndValue): Deleted.
3481         (WebCore::isKeywordPropertyID): Deleted.
3482         * css/CSSParser.h:
3483         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
3484         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
3485         FontVariantEastAsian type.
3486         (WebCore::applyValueFontVariantLigatures):
3487         (WebCore::applyValueFontVariantNumeric):
3488         (WebCore::applyValueFontVariantEastAsian):
3489         * css/StyleProperties.cpp: Update to use the more specific property.
3490         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
3491         (WebCore::StyleProperties::fontValue):
3492         (WebCore::StyleProperties::asText):
3493         * css/StyleResolver.cpp: Ditto.
3494         (WebCore::StyleResolver::isValidCueStyleProperty):
3495         * editing/EditingStyle.cpp: Ditto.
3496         * editing/cocoa/HTMLConverter.mm: Ditto.
3497         (HTMLConverterCaches::propertyValueForNode):
3498         (HTMLConverter::computedAttributesForElement):
3499         * editing/ios/EditorIOS.mm: Ditto.
3500         (WebCore::Editor::removeUnchangeableStyles):
3501         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
3502         (WebCore::CanvasRenderingContext2D::font):
3503         (WebCore::CanvasRenderingContext2D::setFont):
3504         * platform/graphics/FontCache.h: Removing duplicate cache key value.
3505         (WebCore::FontDescriptionKey::makeFlagsKey):
3506         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
3507         (WebCore::FontCascade::glyphDataForCharacter):
3508         * platform/graphics/FontCascade.h: Ditto.
3509         (WebCore::FontCascade::isSmallCaps):
3510         * platform/graphics/FontDescription.cpp: Ditto.
3511         (WebCore::FontDescription::FontDescription):
3512         * platform/graphics/FontDescription.h: Ditto.
3513         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
3514         (WebCore::FontDescription::smallCaps): Deleted.
3515         (WebCore::FontDescription::setSmallCaps): Deleted.
3516         (WebCore::FontDescription::setIsSmallCaps): Deleted.
3517         (WebCore::FontDescription::operator==): Deleted.
3518         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
3519         (WebCore::computeFeatureSettingsFromVariants):
3520         * platform/text/TextFlags.h: Ditto.
3521         (WebCore::FontVariantSettings::operator==):
3522         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
3523         (WebCore::RenderText::widthFromCache):
3524
3525 2015-12-02  Alex Christensen  <achristensen@webkit.org>
3526
3527         Reduce size of ScriptElement
3528         https://bugs.webkit.org/show_bug.cgi?id=151786
3529
3530         Reviewed by Andreas Kling.
3531
3532         * dom/ScriptElement.cpp:
3533         (WebCore::ScriptElement::ScriptElement):
3534         (WebCore::ScriptElement::requestScript):
3535         * dom/ScriptElement.h:
3536         Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used.
3537         Use bit fields for the boolean values to save another 8 bytes per ScriptElement.
3538         This reduces sizeof(ScriptElement) from 168 to 48 bytes.
3539
3540 2015-12-02  Alex Christensen  <achristensen@webkit.org>
3541
3542         Asynchronously call onerror when a content blocker blocks ascript element's load
3543         https://bugs.webkit.org/show_bug.cgi?id=151649
3544
3545         Reviewed by Brady Eidson.
3546
3547         Test: http/tests/contentextensions/script-onerror.html
3548
3549         * dom/ScriptElement.cpp:
3550         (WebCore::ScriptElement::ScriptElement):
3551         (WebCore::ScriptElement::requestScript):
3552         * dom/ScriptElement.h:
3553
3554 2015-12-02  Jer Noble  <jer.noble@apple.com>
3555
3556         [iOS] Abrupt transition between Fullscreen -> PiP
3557         https://bugs.webkit.org/show_bug.cgi?id=151719
3558
3559         Reviewed by Eric Carlson.
3560
3561         Follow-up to r192922: When moving from inline -> PiP, don't forget to hide the fullscreen
3562         window once the PiP transition completes.
3563
3564         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3565         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
3566
3567 2015-12-02  Commit Queue  <commit-queue@webkit.org>
3568
3569         Unreviewed, rolling out r192955.
3570         https://bugs.webkit.org/show_bug.cgi?id=151776
3571
3572         A large number of the tests added with this change are failing
3573         on Windows (Requested by ryanhaddad on #webkit).
3574
3575         Reverted changeset:
3576
3577         "[css border] border-image doesn't honor border-style"
3578         https://bugs.webkit.org/show_bug.cgi?id=99922
3579         http://trac.webkit.org/changeset/192955
3580
3581 2015-12-02  Yoav Weiss  <yoav@yoav.ws>
3582
3583         Fix preloader issue with srcdoc documents.
3584         https://bugs.webkit.org/show_bug.cgi?id=151744
3585
3586         Reviewed by Ryosuke Niwa.
3587
3588         Make sure that PreloadRequest is resolving URLs based on the document's
3589         baseURL() rather than using url() as the base URL, which is not how URLs
3590         are resolved by the parser, and fails when document->url() diverges from
3591         the document's base URL (e.g. in the case of srcdoc based documents).
3592
3593         Test: fast/preloader/iframe-srcdoc.html
3594
3595         * html/parser/HTMLResourcePreloader.cpp:
3596         (WebCore::PreloadRequest::completeURL):
3597
3598 2015-12-02  Jer Noble  <jer.noble@apple.com>
3599
3600         Add a setting and restriction which will pause invisible autoplaying video
3601         https://bugs.webkit.org/show_bug.cgi?id=151412
3602
3603         Reviewed by Eric Carlson.
3604
3605         Test: media/video-restricted-invisible-autoplay-not-allowed.html
3606
3607         Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
3608         calls did not originate from an explicit request to pause or play, e.g., during an interruption.
3609         This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
3610         interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
3611         restore it when an interruption ends.
3612
3613         Add a means to register for viewport visibility notifications to FrameView, RenderView,
3614         and RenderElement. Elements who wish to recieve these notifications must do so through their
3615         renderer, and thus will have to re-register whenever a new renderer is attached.
3616
3617         Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
3618         out of the viewport, or is hidden with CSS.
3619
3620         Add a setting which controls whether that new restriction is set.
3621
3622         * dom/Element.h:
3623         (WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
3624         * html/HTMLMediaElement.cpp:
3625         (WebCore::HTMLMediaElement::HTMLMediaElement):
3626         (WebCore::HTMLMediaElement::didMoveToNewDocument):
3627         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
3628         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
3629         (WebCore::HTMLMediaElement::resumeAutoplaying):
3630         (WebCore::mediaElementIsAllowedToAutoplay):
3631         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
3632         (WebCore::HTMLMediaElement::updateShouldAutoplay):
3633         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
3634         (WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
3635         (WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
3636         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
3637         (WebCore::HTMLMediaElement::removedFrom): Ditto.
3638         (WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
3639         (WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
3640         (WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
3641         (WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
3642         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
3643         (WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
3644         (WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
3645         (WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
3646         * html/HTMLMediaElement.h:
3647         * html/MediaElementSession.cpp:
3648         (WebCore::restrictionName): Added support for new restriction.
3649         * html/MediaElementSession.h:
3650         * page/FrameView.cpp:
3651         (WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
3652         * page/Settings.in:
3653         * platform/audio/PlatformMediaSession.cpp:
3654         (WebCore::stateName): Add new "Autoplay" state.
3655         (WebCore::interruptionName): Added new interruption type.
3656         (WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
3657         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
3658         * platform/audio/PlatformMediaSession.h:
3659         (WebCore::PlatformMediaSession::interruptionType): Added getter.
3660         (WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
3661         * platform/audio/PlatformMediaSessionManager.cpp:
3662         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
3663         * rendering/RenderElement.cpp:
3664         (WebCore::RenderElement::RenderElement): Set new ivars.
3665         (WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
3666         (WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
3667         (WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
3668         (WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
3669         * rendering/RenderElement.h:
3670         * rendering/RenderView.cpp:
3671         (WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
3672         (WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
3673         (WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
3674         * rendering/RenderView.h:
3675         * testing/Internals.cpp:
3676         (WebCore::Internals::setMediaElementRestrictions): Support new restriction.
3677
3678 2015-12-02  Brady Eidson  <beidson@apple.com>
3679
3680         Modern IDB: IDBTransaction::error is not exposed.
3681         https://bugs.webkit.org/show_bug.cgi?id=151752
3682
3683         Reviewed by Alex Christensen.
3684
3685         No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
3686
3687         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3688         (WebCore::IDBClient::IDBRequest::dispatchEvent):
3689         (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
3690         * Modules/indexeddb/client/IDBRequestImpl.h:
3691         
3692         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3693         (WebCore::IDBClient::IDBTransaction::error):
3694         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
3695         (WebCore::IDBClient::IDBTransaction::abort):
3696         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
3697         * Modules/indexeddb/client/IDBTransactionImpl.h:
3698
3699 2015-12-02  Adenilson Cavalcanti  <cavalcantii@gmail.com>
3700
3701         [css border] border-image doesn't honor border-style
3702         https://bugs.webkit.org/show_bug.cgi?id=99922
3703
3704         Reviewed by Simon Fraser.
3705
3706         Ensure that WebKit will be compliant to css-backgrounds spec where a
3707         border with an image will only be rendered if there is a style defined.
3708
3709         Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
3710         Reference: http://www.w3.org/TR/css3-background/#border-style
3711
3712         From W3C discussion: "The fact that these properties set the style of the border is
3713         normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html
3714
3715         Test: fast/borders/border-image-should-not-display.html
3716
3717         * rendering/style/BorderData.h:
3718         (WebCore::BorderData::hasBorder):
3719         (WebCore::BorderData::borderLeftWidth):
3720         (WebCore::BorderData::borderRightWidth):
3721         (WebCore::BorderData::borderTopWidth):
3722         (WebCore::BorderData::borderBottomWidth):
3723         * rendering/style/BorderValue.h:
3724         (WebCore::BorderValue::nonZero):
3725         (WebCore::BorderValue::isVisible):
3726
3727 2015-12-02  Eric Carlson  <eric.carlson@apple.com>
3728
3729         [MediaStream] Implement MediaStreamTrack.getSettings()
3730         https://bugs.webkit.org/show_bug.cgi?id=151727
3731
3732         Reviewed by Jer Noble.
3733
3734         MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings. 
3735
3736         Test: fast/mediastream/MediaStreamTrack-getSettings.html
3737
3738         * CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
3739         * DerivedSources.make: No more MediaSourceStates.idl.
3740         * Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
3741         * Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
3742         (WebCore::MediaSourceSettings::create):
3743         (WebCore::MediaSourceSettings::MediaSourceSettings):
3744         (WebCore::MediaSourceSettings::facingMode):
3745         (WebCore::MediaSourceStates::create): Deleted.
3746         (WebCore::MediaSourceStates::MediaSourceStates): Deleted.
3747         (WebCore::MediaSourceStates::sourceType): Deleted.
3748         (WebCore::MediaSourceStates::facingMode): Deleted.
3749         * Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.
3750
3751         MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
3752         * Modules/mediastream/MediaSourceStates.cpp: Removed.
3753         * Modules/mediastream/MediaSourceStates.h: Removed.
3754         * Modules/mediastream/MediaSourceStates.idl: Removed.
3755
3756         * Modules/mediastream/MediaStreamCapabilities.cpp:
3757         (WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
3758           by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
3759         (WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
3760         (WebCore::MediaStreamCapabilities::facingMode): Ditto.
3761
3762         * Modules/mediastream/MediaStreamTrack.cpp:
3763         (WebCore::MediaStreamTrack::getSettings): New.
3764         (WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
3765           private track returns.
3766         (WebCore::MediaStreamTrack::trackSettingsChanged):
3767         (WebCore::MediaStreamTrack::states): Deleted.
3768         (WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
3769         * Modules/mediastream/MediaStreamTrack.h:
3770         * Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.
3771
3772         * Modules/webaudio/MediaStreamAudioSource.cpp:
3773         (WebCore::MediaStreamAudioSource::settings):
3774         (WebCore::MediaStreamAudioSource::states): Deleted.
3775         * Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.
3776
3777         * WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.
3778
3779         * bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
3780         * bindings/js/JSMediaStreamTrackCustom.cpp: Added.
3781         (WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so 
3782           it has to be generated manually.
3783
3784         * platform/mediastream/MediaStreamPrivate.cpp:
3785         (WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
3786         (WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
3787         * platform/mediastream/MediaStreamPrivate.h:
3788
3789         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3790         (WebCore::MediaStreamTrackPrivate::settings):
3791         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
3792         (WebCore::MediaStreamTrackPrivate::states): Deleted.
3793         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
3794         * platform/mediastream/MediaStreamTrackPrivate.h:
3795
3796         * platform/mediastream/RealtimeMediaSource.cpp:
3797         (WebCore::RealtimeMediaSource::settingsDidChanged):
3798         (WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
3799         * platform/mediastream/RealtimeMediaSource.h:
3800
3801         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
3802         (WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
3803         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
3804         (WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
3805         (WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
3806         (WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.
3807
3808         * platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
3809         * platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
3810         (WebCore::RealtimeMediaSourceSettings::facingMode):
3811         (WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
3812         (WebCore::RealtimeMediaSourceStates::sourceType): Deleted.
3813
3814         * platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
3815         * platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.
3816
3817         * platform/mediastream/RealtimeMediaSourceStates.h: Removed.
3818         * platform/mediastream/mac/AVAudioCaptureSource.h:
3819         * platform/mediastream/mac/AVAudioCaptureSource.mm:
3820         (WebCore::AVAudioCaptureSource::updateStates): Deleted.
3821
3822         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3823         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3824
3825         * platform/mediastream/mac/AVMediaCaptureSource.h:
3826         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3827         (WebCore::AVMediaCaptureSource::states): Deleted.
3828
3829         * platform/mediastream/mac/AVVideoCaptureSource.h:
3830         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3831         (WebCore::AVVideoCaptureSource::updateStates): Deleted.
3832
3833         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3834
3835         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
3836
3837         * platform/mock/MockRealtimeAudioSource.cpp:
3838         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
3839         (WebCore::MockRealtimeAudioSource::updateStates): Deleted.
3840         * platform/mock/MockRealtimeAudioSource.h:
3841
3842         * platform/mock/MockRealtimeMediaSource.cpp:
3843         (WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
3844         (WebCore::MockRealtimeMediaSource::settings):
3845         (WebCore::MockRealtimeMediaSource::supportedConstraints):
3846         (WebCore::MockRealtimeMediaSource::states): Deleted.
3847         * platform/mock/MockRealtimeMediaSource.h:
3848         (WebCore::MockRealtimeMediaSource::constraints):
3849         (WebCore::MockRealtimeMediaSource::currentStates): Deleted.
3850
3851         * platform/mock/MockRealtimeVideoSource.cpp:
3852         (WebCore::MockRealtimeVideoSource::updateSettings):
3853         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
3854         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
3855         (WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
3856         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
3857         (WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
3858         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3859         (WebCore::MockRealtimeVideoSource::updateStates): Deleted.
3860         (WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
3861         * platform/mock/MockRealtimeVideoSource.h:
3862
3863 2015-11-30  David Hyatt  <hyatt@apple.com>
3864
3865         Implement the picture element.
3866         https://bugs.webkit.org/show_bug.cgi?id=116963
3867
3868         Reviewed by Dean Jackson.
3869
3870         Added fast/picture tests.
3871
3872         * WebCore.xcodeproj/project.pbxproj:
3873         Add HTMLPictureElement.* to the project.
3874
3875         * html/HTMLImageElement.cpp:
3876         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
3877         Remove the CURRENT_SRC ifdef.
3878
3879         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3880         New helper function that checks the <source> elements of a <picture> parent
3881         for the best match.
3882
3883         (WebCore::HTMLImageElement::selectImageSource):
3884         Pull out the process of image selection into its own function so that this can
3885         be called from many places (to ensure that dynamic changes are reflected as elements
3886         get changed, added or removed).
3887
3888         (WebCore::HTMLImageElement::parseAttribute):
3889         Call selectImageSource when attributes change.
3890
3891         (WebCore::HTMLImageElement::insertedInto):
3892         If inserted into a picture element, make sure to update the source.
3893
3894         * html/HTMLImageElement.h:
3895         (WebCore::HTMLImageElement::currentSrc):
3896         Remove the CURRENT_SRC ifdef.
3897
3898         * html/HTMLImageElement.idl:
3899         Remove the CURRENT_SRC ifdef.
3900
3901         * html/HTMLPictureElement.cpp: Added.
3902         (WebCore::HTMLPictureElement::HTMLPictureElement):
3903         (WebCore::HTMLPictureElement::create):
3904         (WebCore::HTMLPictureElement::sourcesChanged):
3905         * html/HTMLPictureElement.h: Added.
3906         The new picture element. Has a sourcesChanged() function that is invoked whenever anything
3907         about the <source> elements changes.
3908
3909         * html/HTMLSourceElement.cpp:
3910         (WebCore::HTMLSourceElement::insertedInto):
3911         (WebCore::HTMLSourceElement::removedFrom):
3912         (WebCore::HTMLSourceElement::parseAttribute):
3913         Make sure to call sourcesChanged when new sources come and go or when attributes on
3914         source elements change.
3915
3916         * html/HTMLSourceElement.h:
3917         Added parseAttribute function so we can see when attributes change that force us to
3918         do a dynamic update.
3919
3920         * html/HTMLTagNames.in:
3921         Add the picture element.
3922
3923         * html/parser/HTMLSrcsetParser.h:
3924         (WebCore::ImageCandidate::srcOrigin):
3925         (WebCore::ImageCandidate::isEmpty):
3926         Some helpers for picture parsing.
3927
3928 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
3929
3930         [WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
3931         https://bugs.webkit.org/show_bug.cgi?id=151757
3932
3933         Reviewed by Alex Christensen.
3934
3935         We need to make sure we use the same bitmap format as in the Direct3D surface
3936         in video memory when copying surface data and rendering with Cairo.
3937
3938         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3939         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
3940         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
3941
3942 2015-12-02  Brady Eidson  <beidson@apple.com>
3943
3944         Modern IDB: Get rid of IDBExceptionCode.
3945         https://bugs.webkit.org/show_bug.cgi?id=151753
3946
3947         Reviewed by Alex Christensen.
3948
3949         No new tests (No change in behavior).
3950
3951         * Modules/indexeddb/client/IDBIndexImpl.cpp:
3952         (WebCore::IDBClient::IDBIndex::count):
3953         (WebCore::IDBClient::IDBIndex::doCount):
3954         (WebCore::IDBClient::IDBIndex::get):
3955         (WebCore::IDBClient::IDBIndex::doGet):
3956         (WebCore::IDBClient::IDBIndex::getKey):
3957         (WebCore::IDBClient::IDBIndex::doGetKey):
3958         
3959         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3960         (WebCore::IDBClient::IDBObjectStore::get):
3961         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
3962         (WebCore::IDBClient::IDBObjectStore::clear):
3963         (WebCore::IDBClient::IDBObjectStore::createIndex):
3964         (WebCore::IDBClient::IDBObjectStore::index):
3965         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
3966         (WebCore::IDBClient::IDBObjectStore::count):
3967         (WebCore::IDBClient::IDBObjectStore::doCount):
3968         
3969         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3970         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
3971         
3972         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3973         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
3974         
3975         * Modules/indexeddb/server/IndexValueStore.cpp:
3976         (WebCore::IDBServer::IndexValueStore::addRecord):
3977         
3978         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3979         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
3980         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
3981         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
3982         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
3983         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
3984         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
3985         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
3986         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
3987         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
3988         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
3989         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3990         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
3991         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
3992         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
3993         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
3994