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