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