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