Hook up request and show for typing candidates in WK1
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-07  Beth Dakin  <bdakin@apple.com>
2
3         Hook up request and show for typing candidates in WK1
4         https://bugs.webkit.org/show_bug.cgi?id=151831
5         -and corresponding-
6         <rdar://problem/23751214>
7
8         Reviewed by Enrica Casucci.
9
10         New SPI that is needed.
11         * WebCore.xcodeproj/project.pbxproj:
12         * platform/spi/mac/NSSpellCheckerSPI.h: Added.
13
14         Request candidates for editable content whenever selection changes.
15         * editing/Editor.cpp:
16         (WebCore::Editor::respondToChangedSelection):
17
18         Implement requestCandidatesForSelection on the EditorClient.
19         * loader/EmptyClients.h:
20         * page/EditorClient.h:
21         (WebCore::EditorClient::requestCandidatesForSelection):
22
23 2015-12-07  Brady Eidson  <beidson@apple.com>
24
25         Modern IDB: Fix "old versions" when upgrading databases.
26         https://bugs.webkit.org/show_bug.cgi?id=151948
27
28         Reviewed by Alex Christensen.
29
30         No new tests (5 failing tests now pass, and updated results for a 6th test).
31
32         This includes the old version on the IDBVersionChangeEvent, as well as the version the 
33         IDBDatabase is left with if the version change transaction is aborted.
34
35         Primary mechanism of the fix is to include the original IDBDatabaseInfo along with 
36         IDBTransactionInfos that represent version change transactions.
37
38         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
39         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
40         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
41
42         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
43         (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
44
45         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
46         (WebCore::IDBClient::IDBTransaction::IDBTransaction): Deleted.
47         (WebCore::IDBClient::IDBTransaction::finishAbortOrCommit): Deleted.
48         * Modules/indexeddb/client/IDBTransactionImpl.h:
49         (WebCore::IDBClient::IDBTransaction::info):
50         (WebCore::IDBClient::IDBTransaction::originalDatabaseInfo):
51
52         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
53         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
54         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
55         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
56         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
57
58         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
59         (WebCore::IDBTransactionInfo::versionChange):
60         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
61         (WebCore::IDBTransactionInfo::isolatedCopy):
62         * Modules/indexeddb/shared/IDBTransactionInfo.h:
63         (WebCore::IDBTransactionInfo::originalDatabaseInfo):
64
65 2015-12-07  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
66
67         Update Objective-C code generator to pass a reference to calling object for partial interfaces
68         https://bugs.webkit.org/show_bug.cgi?id=151739
69
70         Reviewed by Darin Adler.
71
72         The fix updates the Objective-C code generator to pass a reference to calling object for partial interfaces.
73         The change from pass by pointer to pass by reference was introduced in r192849.
74
75         * bindings/scripts/CodeGeneratorObjC.pm:
76         (GenerateImplementation):
77         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
78         (-[DOMTestInterface supplementalStr1]):
79         (-[DOMTestInterface supplementalStr2]):
80         (-[DOMTestInterface setSupplementalStr2:]):
81         (-[DOMTestInterface supplementalStr3]):
82         (-[DOMTestInterface setSupplementalStr3:]):
83         (-[DOMTestInterface supplementalNode]):
84         (-[DOMTestInterface setSupplementalNode:]):
85         (-[DOMTestInterface builtinAttribute]):
86         (-[DOMTestInterface setBuiltinAttribute:]):
87         (-[DOMTestInterface supplementalMethod1]):
88         (-[DOMTestInterface supplementalMethod2:objArg:]):
89         (-[DOMTestInterface supplementalMethod3]):
90         (-[DOMTestInterface supplementalMethod4]):
91         (-[DOMTestInterface builtinFunction]):
92
93 2015-12-07  Chris Dumez  <cdumez@apple.com>
94
95         Crash in MemoryCache::pruneDeadResourcesToSize()
96         https://bugs.webkit.org/show_bug.cgi?id=151833
97         <rdar://problem/22392235>
98
99         Reviewed by David Kilzer.
100
101         MemoryCache::pruneDeadResourcesToSize() is iterating over m_allResources
102         (which is a vector of LRUList). It first destroys decoded data for each
103         resource in the LRUList. Then, if it does not suffice to reach the
104         target size, and starts actually removing resources from the cache.
105
106         The issue is that this code alters m_allResources (and its LRULists) as
107         it is iterating over it. We tried to deal with this in various ways:
108         1. Increment the iterator before removing the resource pointed by the
109           iterator.
110         2. Protect the next resource in the LRUList and abort early if it is no
111           longer in the cache.
112
113         This adds code complexity and apparently does not correctly handle all
114         the edge cases as we still see crashes in this code. In particular, I
115         suspect that 2. may not be sufficient if it is possible for the next
116         resource to be moved to another LRUList (in which case, next->inCache()
117         would still return true but the iterator would however become invalid).
118
119         To make the code simpler and more robust, this patch copies the LRUList
120         (and refs the CachedResources) before iterating over it. This is a lot
121         safer and should hopefully fix the crashes we see in this function.
122
123         No new tests, no reproduction case.
124
125         * loader/cache/MemoryCache.cpp:
126         (WebCore::MemoryCache::pruneDeadResourcesToSize):
127
128 2015-12-07  Brady Eidson  <beidson@apple.com>
129
130         Modern IDB: Add some more custom exception messages, passing some more tests..
131         https://bugs.webkit.org/show_bug.cgi?id=151912
132
133         Reviewed by Andy Estes.
134
135         No new tests (Covered by existing tests).
136
137         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
138         (WebCore::IDBClient::IDBObjectStore::index):
139         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
140         (WebCore::IDBClient::IDBTransaction::objectStore):
141
142 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
143
144         [ThreadedCompositor] Add support for PlatformLayer.
145         https://bugs.webkit.org/show_bug.cgi?id=143299
146
147         Reviewed by Žan Doberšek.
148
149         This patch implements TextureMapperPlatformLayerProxy and TextureMapperPlatformLayerBuffer to
150         send a texture (actual texture or BitmapTexture) to the compositing thread directly.
151         Platform layer renderers should implement TextureMapperPlatformLayerProxyProvider to establish
152         a connection to the compositing thread. After the connection has been established, the renderer
153         can render its contents to the TextureMapperPlatformLayerBuffer and pass it to the compositing thread
154         via TextureMapperPlatformLayer proxy.
155         The buffer can be an unmanaged texture (a.k.a. platform texture) or BitmapTexture.
156         For the unmanaged texture, the renderer should manage its life cycle itself. For the BitmapTexture,
157         it will be managed by TextureMapperPlatformLayerProxy. In that case, used (swapped) buffer will be
158         recycled because the renderer will use same size and format until it changes its size.
159
160         No new tests needed.
161
162         * PlatformGTK.cmake:
163         Adds TextureMapperPlatformLayerBuffer and TextureMapperPlaytformLayerProxy.
164
165         * platform/graphics/GraphicsContext3DPrivate.cpp:
166         * platform/graphics/GraphicsContext3DPrivate.h:
167         * platform/graphics/cairo/ImageBufferCairo.cpp:
168         * platform/graphics/cairo/ImageBufferDataCairo.h:
169         Adds mock implementation.
170
171         * platform/graphics/PlatformLayer.h:
172         Adds TextureMapperPlatformLayerProxyProvider as a PlatformLayer for the Threaded Compositor
173
174         * platform/graphics/texmap/BitmapTextureGL.h:
175         (WebCore::BitmapTextureGL::internalFormat): Adds a getter to check the
176         internal format of texture to check reusability.
177
178         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
179         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
180         * platform/graphics/texmap/TextureMapperLayer.cpp:
181         * platform/graphics/texmap/TextureMapperLayer.h:
182         Exclude GraphicsLayerTextureMapper from build when we are using Coordinated Graphics.
183
184         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: Added.
185         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: Added.
186         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: Added.
187         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: Added.
188
189         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
190         (WebCore::GraphicsLayer::create):
191         Because we removed GraphicsLayerTextureMapper from build, we need to add own factory function.
192
193         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
194         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
195         (WebCore::CoordinatedGraphicsLayer::platformLayerWillBeDestroyed):
196         (WebCore::CoordinatedGraphicsLayer::setPlatformLayerNeedsDisplay):
197         Implements sync operations for TextureMapperPlatformLayerProxy
198
199 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
200
201         Fix GTK+ build with GStreamer GL
202         https://bugs.webkit.org/show_bug.cgi?id=151939
203
204         Reviewed by Žan Doberšek.
205
206         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
207         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
208         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
209         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback):
210         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
211
212 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
213
214         Show more information about SVG renderers in showLayerTree() output
215         https://bugs.webkit.org/show_bug.cgi?id=151930
216
217         Reviewed by Zalan Bujtas.
218         
219         In showLayerTree() output, for SVG renderers show:
220         - visual and layout overflow, for boxes
221         - frame rect, for boxes
222         - layout state
223         - class and id
224
225         * rendering/RenderLayer.cpp:
226         (WebCore::showLayerTree):
227         * rendering/RenderTreeAsText.cpp:
228         (WebCore::RenderTreeAsText::writeRenderObject):
229         (WebCore::writeDebugInfo): New function to share dumping with svg output.
230         (WebCore::write):
231         * rendering/RenderTreeAsText.h:
232         * rendering/svg/SVGRenderTreeAsText.cpp:
233         (WebCore::writePositionAndStyle): Show the frameRect for boxes (e.g. RenderSVGRoot).
234         Much more useful that showing the clippedOverflowRect.
235         (WebCore::writeStandardPrefix):
236         (WebCore::writeChildren):
237         (WebCore::writeSVGResourceContainer):
238         (WebCore::writeSVGContainer):
239         (WebCore::write):
240         (WebCore::writeSVGText):
241         (WebCore::writeSVGInlineText):
242         (WebCore::writeSVGImage):
243         (WebCore::writeSVGGradientStop):
244         (WebCore::writeResources):
245         (WebCore::operator<<): Deleted.
246         * rendering/svg/SVGRenderTreeAsText.h:
247
248 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
249
250         Clipping along compositing borders in svg-edit
251         https://bugs.webkit.org/show_bug.cgi?id=151791
252
253         Reviewed by Zalan Bujtas.
254         
255         RenderSVGRoot::layout() failed to clear overflow before recomputing
256         visual overflow, which could cause it to get stuck with stale overflow.
257         This would cause underpainting if its size went from small to large.
258
259         Test: svg/overflow/visual-overflow-change.html
260
261         * rendering/svg/RenderSVGRoot.cpp:
262         (WebCore::RenderSVGRoot::layout):
263
264 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
265
266         REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
267         https://bugs.webkit.org/show_bug.cgi?id=151849
268         rdar://problem/23132828
269
270         Reviewed by Zalan Bujtas.
271         
272         This page uses a fill-forwards animation where the last keyframe has height: auto.
273         After r187121, we tried to blend the height Length value from the last keyframe to the
274         first keyframe with progress=0 (which should pick up the 'auto' from the last keyframe).
275         
276         However, Length::blend() just considered both 0 and 'auto' to be zero, and returned
277         the 0 length.
278         
279         So fix Length::blend() to return the "from" length if progress is zero.
280
281         Test: animations/fill-forwards-auto-height.html
282
283         * page/animation/CSSPropertyAnimation.cpp:
284         (WebCore::blendFunc): Length::blend takes a double, so don't narrow to float.
285         * page/animation/KeyframeAnimation.cpp:
286         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Declare two variables
287         at first use.
288         * platform/Length.h:
289         (WebCore::Length::blend):
290
291 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
292
293         Give SVGTransformList some inline vector capacity
294         https://bugs.webkit.org/show_bug.cgi?id=151644
295
296         Reviewed by Andreas Kling.
297
298         Giving SVGTransformList inline capacity of one drops time under SVGTransformList::parse() by
299         about 1% on http://animateplus.com/demos/stress-test/
300
301         * svg/SVGTransformList.h:
302
303 2015-12-06  Zalan Bujtas  <zalan@apple.com>
304
305         Addressing post-review comments on r193374.
306
307         Reviewed by Antti Koivisto.
308
309         * rendering/SimpleLineLayout.cpp:
310         (WebCore::SimpleLineLayout::canUseForText):
311         (WebCore::SimpleLineLayout::canUseForFontAndText):
312         (WebCore::SimpleLineLayout::canUseForStyle):
313         (WebCore::SimpleLineLayout::canUseForWithReason):
314         (WebCore::SimpleLineLayout::canUseFor):
315         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
316         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
317
318 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
319
320         Remove CORETEXT_WEB_FONTS
321         https://bugs.webkit.org/show_bug.cgi?id=151891
322
323         Reviewed by Simon Fraser.
324
325         The only platform where this was turned off (Mavericks) is no longer supported.
326
327         No new tests because there is no behavior difference.
328
329         * platform/graphics/cocoa/FontCocoa.mm:
330         (WebCore::Font::platformCreateScaledFont): Deleted.
331         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
332         (WebCore::FontPlatformData::registeredFont):
333         (WebCore::FontPlatformData::ctFont):
334         * platform/graphics/mac/FontCustomPlatformData.cpp:
335         (WebCore::FontCustomPlatformData::fontPlatformData): Deleted.
336         (WebCore::createFontCustomPlatformData): Deleted.
337         * platform/graphics/mac/FontCustomPlatformData.h:
338         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Deleted.
339         * platform/text/TextFlags.h:
340
341 2015-12-04  Zalan Bujtas  <zalan@apple.com>
342
343         Garbage in page tiles when document is too long.
344         https://bugs.webkit.org/show_bug.cgi?id=151906
345         rdar://problem/23695858
346
347         Reviewed by Simon Fraser.
348
349         This patch partially fixes the broken concept(webkit.org/b/151908) of having a nearlyMax/2 sized rectangle to define infiniteness.
350         (see LayoutRect::infiniteRect() and ClipRect::isInfinite())
351
352         Covered by existing test.
353
354         * rendering/ClipRect.h: Branch for infinite clipping.
355         (WebCore::ClipRect::intersect):
356         (WebCore::ClipRect::intersects):
357         * rendering/RenderLayer.cpp:
358         (WebCore::RenderLayer::clipToRect): Do not clip when clipping is infinite.
359         (WebCore::RenderLayer::restoreClip):
360         (WebCore::RenderLayer::calculateClipRects):
361
362 2015-12-04  Brady Eidson  <beidson@apple.com>
363
364         Modern IDB: Add some more custom exception messages, passing some more tests.
365         https://bugs.webkit.org/show_bug.cgi?id=151898
366
367         Reviewed by Alex Christensen.
368
369         No new tests (Some failing tests now pass).
370
371         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
372         (WebCore::IDBClient::IDBTransaction::objectStore):
373
374 2015-12-04  Brent Fulgham  <bfulgham@apple.com>
375
376         Place an upper bound on canvas pixel count
377         https://bugs.webkit.org/show_bug.cgi?id=151825
378         <rdar://problem/23324916>
379
380         Reviewed by Simon Fraser.
381
382         Malformed JavaScript can attempt to create lots of canvas contexts. Limit the amount of memory
383         we will use for this purpose to some percentage of system RAM.
384
385         * html/HTMLCanvasElement.cpp:
386         (WebCore::removeFromActivePixelMemory): Added helper function
387         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Call new 'releaseImageBufferAndContext' method
388         to ensure ImageBuffer and graphics context state are properly cleaned up.
389         (WebCore::maxActivePixels): Use one quarter of the system RAM, or 1 GB (whichever is more) as
390         an upper bound on active pixel memory.
391         (WebCore::HTMLCanvasElement::getContext): If we are attempting to create a context that will cause
392         us to exceed the allowed active pixel count, fail.
393         (WebCore::HTMLCanvasElement::releaseImageBufferAndContext): Added helper function
394         (WebCore::HTMLCanvasElement::setSurfaceSize): Use the new 'releaseImageBufferAndContext' method
395         to handle active pixel memory counts.
396         (WebCore::HTMLCanvasElement::createImageBuffer): Refuse to create a backing buffer if it will
397         exceed our available pixel memory.
398
399 2015-12-04  Brady Eidson  <beidson@apple.com>
400
401         Modern IDB: Add some more custom exception messages, passing some more tests.
402         https://bugs.webkit.org/show_bug.cgi?id=151895
403
404         Reviewed by Alex Christensen.
405
406         No new tests (Some failing tests now pass).
407
408         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
409         (WebCore::IDBClient::IDBDatabase::transaction):
410
411         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
412         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
413
414 2015-12-04  Jonathan Davis  <jond@apple.com>
415
416         Update feature status for up-to-date status information.
417         https://bugs.webkit.org/show_bug.cgi?id=151821
418
419         Reviewed by Timothy Hatcher.
420
421         * features.json:
422
423 2015-12-04  Brady Eidson  <beidson@apple.com>
424
425         Modern IDB: Flip test expectations around so we only list failures.
426         https://bugs.webkit.org/show_bug.cgi?id=151880
427
428         Reviewed by Alex Christensen.
429
430         No new tests (Covered by all existing tests).
431
432         * Modules/indexeddb/client/IDBRequestImpl.cpp:
433         (WebCore::IDBClient::IDBRequest::stop):
434         (WebCore::IDBClient::IDBRequest::enqueueEvent):
435         (WebCore::IDBClient::IDBRequest::dispatchEvent):
436         * Modules/indexeddb/client/IDBRequestImpl.h:
437         
438         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
439         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
440         (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
441         (WebCore::IDBClient::IDBTransaction::stop):
442         (WebCore::IDBClient::IDBTransaction::enqueueEvent):
443         (WebCore::IDBClient::IDBTransaction::dispatchEvent):
444         * Modules/indexeddb/client/IDBTransactionImpl.h:
445         
446         * bindings/js/IDBBindingUtilities.cpp:
447         (WebCore::idbKeyToScriptValue): Protection against a ScriptExecutionContext that no longer has an ExecState.
448           A full reworking on the binding utilities to prevent this through is covered by b/151890
449
450 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
451
452         [Cocoa] Some fonts cause CTFontCopyAvailableTables() to return nullptr
453         https://bugs.webkit.org/show_bug.cgi?id=151884
454         <rdar://problem/23752253>
455
456         Reviewed by Brian Burg.
457
458         No new tests.
459
460         * platform/graphics/opentype/OpenTypeCG.cpp:
461         (WebCore::OpenType::fontHasMathTable):
462
463 2015-12-04  Jer Noble  <jer.noble@apple.com>
464
465         Unreviewed build-fix; Add new parameter to overloaded createSession() method in MediaPlayerPrivateAVFoundationCF.
466
467         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
468         (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
469         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
470         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
471         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
472         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
473
474 2015-12-01  Jer Noble  <jer.noble@apple.com>
475
476         Adopt AVContentKeySession
477         https://bugs.webkit.org/show_bug.cgi?id=151221
478
479         Reviewed by Eric Carlson.
480
481         Adopt a new API for managing key state, AVContentKeySession. Because this necessitates a change
482         in both the initialization data returned by the needkey event, and passed into the createSession()
483         method, bump the protocol version number (to 3), and keep supporting the old key management API
484         for legacy content.
485
486         To do so, move most of the implementation of CDMPrivateMediaSourceAVFObjC into a new subclass,
487         CDMSessionAVStreamSession, and add a new subclass, CDMSessionAVContentKeySession, to support the
488         new API.
489
490         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
491         (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Moved to implementation file.
492         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
493         (WebCore::validKeySystemRE): Support "com.apple.fps.3_x".
494         (WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Invalidate all outstanding sessions.
495         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Only support "com.apple.fps.3_x" if the AVContentKeySession class is available.
496         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Create an instance of CDMSessionAVContentKeySession if "com.apple.fps.3_x" is specified and AVContentKeySession is available.
497         (WebCore::CDMPrivateMediaSourceAVFObjC::invalidateSession): Remove session from the list of outstanding sessions.
498         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Deleted.
499         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
500         (WebCore::CDMSessionAVContentKeySession::hasContentKeySession): Simple accessor.
501         (WebCore::toCDMSessionAVContentKeySession): Safe casting.
502         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Added.
503         (-[CDMSessionAVContentKeySessionDelegate initWithParent:]): Simple constructor.
504         (-[CDMSessionAVContentKeySessionDelegate invalidate]): Remove reference to parent.
505         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:willProvideKeyRequestInitializationDataForTrackID:]): Pass to parent.
506         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:didProvideKeyRequestInitializationData:requestHandling:]): Ditto.
507         (-[CDMSessionAVContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]): Ditto.
508         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession): Create the delegate.
509         (WebCore::CDMSessionAVContentKeySession::~CDMSessionAVContentKeySession): Invalidate the delegate and remove all parsers.
510         (WebCore::CDMSessionAVContentKeySession::isAvailable): Return true if AVContentKeySession class is available.
511         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest): Support "keyrelease" message, setting of the certificate, and creating key request object. 
512         (WebCore::CDMSessionAVContentKeySession::releaseKeys): Retrieve keys from storage location.
513         (WebCore::isEqual): Compares a Uint8Array to a char*.
514         (WebCore::CDMSessionAVContentKeySession::update): Support "acknowledged" message, "renew" message, and key addition.
515         (WebCore::CDMSessionAVContentKeySession::addParser): Add the parser to the AVContentKeySession.
516         (WebCore::CDMSessionAVContentKeySession::removeParser): Remove parser from same.
517         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): Retrieve key release message from AVContentKeySession.
518         (WebCore::CDMSessionAVContentKeySession::didProvideContentKeyRequest): Simple setter.
519         (WebCore::CDMSessionAVContentKeySession::contentKeySession): Lazily create the AVContentKeySession.
520         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
521         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
522         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
523         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
524         (WebCore::toCDMSessionAVStreamSession):
525         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm.
526         (-[CDMSessionAVStreamSessionObserver initWithParent:]): Moved from CDMSessionMediaSourceAVFObjcObserver.
527         (-[CDMSessionAVStreamSessionObserver contentProtectionSessionIdentifierChanged:]): Ditto.
528         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession): Ditto.
529         (WebCore::CDMSessionAVStreamSession::~CDMSessionAVStreamSession): Ditto.
530         (WebCore::CDMSessionAVStreamSession::generateKeyRequest): Ditto.
531         (WebCore::CDMSessionAVStreamSession::releaseKeys): Ditto.
532         (WebCore::isEqual): Ditto.
533         (WebCore::CDMSessionAVStreamSession::update): Ditto.
534         (WebCore::CDMSessionAVStreamSession::setStreamSession): Ditto.
535         (WebCore::CDMSessionAVStreamSession::addParser): Ditto.
536         (WebCore::CDMSessionAVStreamSession::removeParser): Ditto.
537         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): Ditto.
538         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
539         (WebCore::CDMSessionMediaSourceAVFObjC::invalidateCDM): Clear the m_cdm.
540         (WebCore::toCDMSessionMediaSourceAVFObjC):
541         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
542         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
543         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Instruct our CDM to invalidate their references to us.
544         (WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Call addParser().
545         (WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Call removeParser().
546         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Deleted.
547         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Deleted.
548         
549         To give us a chance to create a CDMPrivate before we continue decoding media data, "block" further decoding
550         on the background thread by creating a semaphore and passing it to the main thread, to be triggered when
551         a CDM is created and attached to this source buffer.
552
553         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
554         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
555         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
556         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
557         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
558         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
559         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
560         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): Deleted.
561         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
562
563         Drive-by fix: Only throw an error from keyRequestTimerFired() if the underlying call to
564         generateKeyRequest() returned an error, rather than just failed to create a message.
565
566         * Modules/encryptedmedia/MediaKeySession.cpp:
567         (WebCore::MediaKeySession::keyRequestTimerFired):
568
569         Drive-by fix: Pass the CDMSessionClient into CDM::createSession() so that it is immediately available
570         in the CDMSessionPrivate constructor, rather than setting the client immediately after construction.
571
572         * Modules/encryptedmedia/CDM.cpp:
573         (WebCore::CDM::createSession):
574         * Modules/encryptedmedia/CDM.h:
575         * Modules/encryptedmedia/CDMPrivate.h:
576         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
577         (WebCore::CDMPrivateClearKey::createSession):
578         * Modules/encryptedmedia/CDMPrivateClearKey.h:
579         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
580         (WebCore::CDMPrivateMediaPlayer::createSession):
581         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
582         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
583         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
584         * Modules/encryptedmedia/CDMSessionClearKey.h:
585         * Modules/encryptedmedia/MediaKeySession.cpp:
586         (WebCore::MediaKeySession::MediaKeySession):
587         * platform/graphics/CDMSession.h:
588         * platform/graphics/MediaPlayer.cpp:
589         (WebCore::MediaPlayer::createSession):
590         * platform/graphics/MediaPlayer.h:
591         * platform/graphics/MediaPlayerPrivate.h:
592         (WebCore::MediaPlayerPrivateInterface::createSession):
593         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
594         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
595         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
596         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
597         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession):
598         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
599         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
600         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::keyNeeded): Deleted.
601         * testing/MockCDM.cpp:
602         (WebCore::MockCDM::createSession):
603         (WebCore::MockCDMSession::MockCDMSession):
604         * testing/MockCDM.h:
605
606         Add new files to the project:
607
608         * WebCore.xcodeproj/project.pbxproj:
609
610
611 2015-12-04  Brady Eidson  <beidson@apple.com>
612
613         Modern IDB: storage/indexeddb/cursor-update.html fails.
614         https://bugs.webkit.org/show_bug.cgi?id=151879
615
616         Reviewed by Oliver Hunt.
617
618         No new tests (At least one failing test now passes).
619
620         * Modules/indexeddb/client/IDBRequestImpl.cpp:
621         (WebCore::IDBClient::IDBRequest::IDBRequest):
622
623 2015-12-04  Brady Eidson  <beidson@apple.com>
624
625         Modern IDB: storage/indexeddb/version-change-exclusive.html fails
626         https://bugs.webkit.org/show_bug.cgi?id=151870
627
628         Reviewed by Alex Christensen.
629
630         Test: storage/indexeddb/modern/double-open.html
631               storage/indexeddb/version-change-exclusive.html
632
633         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
634         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Delay handling open operations
635           while the first is still in progress.
636         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
637         * Modules/indexeddb/server/UniqueIDBDatabase.h:
638
639 2015-12-04  Brady Eidson  <beidson@apple.com>
640
641         Modern IDB: storage/indexeddb/exceptions.html fails.
642         https://bugs.webkit.org/show_bug.cgi?id=151732
643
644         Reviewed by Alex Christensen.
645
646         No new tests (At least one failing test now passes).
647
648         - Lots of customized exception messages for IDB code to match the text expectations.
649         - Updates to the test expectations where we can't/won't match them exactly.
650         - And a couple of little required behavior changes exposed by the test
651
652         * Modules/indexeddb/IDBCursor.h:
653         * Modules/indexeddb/IDBCursor.idl:
654         * Modules/indexeddb/IDBDatabase.h:
655         * Modules/indexeddb/IDBDatabase.idl:
656         * Modules/indexeddb/IDBDatabaseException.cpp:
657         (WebCore::IDBDatabaseException::initializeDescription):
658         * Modules/indexeddb/IDBFactory.h:
659         * Modules/indexeddb/IDBFactory.idl:
660         * Modules/indexeddb/IDBIndex.h:
661         * Modules/indexeddb/IDBIndex.idl:
662         * Modules/indexeddb/IDBObjectStore.h:
663         * Modules/indexeddb/IDBObjectStore.idl:
664         * Modules/indexeddb/IDBRequest.h:
665         * Modules/indexeddb/IDBRequest.idl:
666         * Modules/indexeddb/IDBTransaction.h:
667         * Modules/indexeddb/IDBTransaction.idl:
668         
669         * Modules/indexeddb/client/IDBCursorImpl.cpp:
670         (WebCore::IDBClient::IDBCursor::update):
671         (WebCore::IDBClient::IDBCursor::advance):
672         (WebCore::IDBClient::IDBCursor::continueFunction):
673         (WebCore::IDBClient::IDBCursor::deleteFunction):
674         * Modules/indexeddb/client/IDBCursorImpl.h:
675         
676         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
677         (WebCore::IDBClient::IDBDatabase::createObjectStore):
678         (WebCore::IDBClient::IDBDatabase::transaction):
679         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
680         * Modules/indexeddb/client/IDBDatabaseImpl.h:
681         
682         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
683         (WebCore::IDBClient::IDBFactory::cmp):
684         * Modules/indexeddb/client/IDBFactoryImpl.h:
685         
686         * Modules/indexeddb/client/IDBIndexImpl.cpp:
687         (WebCore::IDBClient::IDBIndex::openCursor):
688         (WebCore::IDBClient::IDBIndex::count):
689         (WebCore::IDBClient::IDBIndex::doCount):
690         (WebCore::IDBClient::IDBIndex::openKeyCursor):
691         (WebCore::IDBClient::IDBIndex::get):
692         (WebCore::IDBClient::IDBIndex::doGet):
693         (WebCore::IDBClient::IDBIndex::getKey):
694         (WebCore::IDBClient::IDBIndex::doGetKey):
695         * Modules/indexeddb/client/IDBIndexImpl.h:
696         
697         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
698         (WebCore::IDBClient::IDBObjectStore::openCursor):
699         (WebCore::IDBClient::IDBObjectStore::get):
700         (WebCore::IDBClient::IDBObjectStore::add):
701         (WebCore::IDBClient::IDBObjectStore::put):
702         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
703         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
704         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
705         (WebCore::IDBClient::IDBObjectStore::clear):
706         (WebCore::IDBClient::IDBObjectStore::createIndex):
707         (WebCore::IDBClient::IDBObjectStore::index):
708         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
709         (WebCore::IDBClient::IDBObjectStore::count):
710         (WebCore::IDBClient::IDBObjectStore::doCount):
711         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
712
713         * Modules/indexeddb/client/IDBRequestImpl.cpp:
714         (WebCore::IDBClient::IDBRequest::result):
715         (WebCore::IDBClient::IDBRequest::error):
716         * Modules/indexeddb/client/IDBRequestImpl.h:
717
718         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
719         (WebCore::IDBClient::IDBTransaction::objectStore):
720         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
721         (WebCore::IDBClient::IDBTransaction::abort):
722         * Modules/indexeddb/client/IDBTransactionImpl.h:
723
724         * Modules/indexeddb/legacy/LegacyCursor.cpp:
725         (WebCore::LegacyCursor::update):
726         (WebCore::LegacyCursor::continueFunction):
727         (WebCore::LegacyCursor::deleteFunction):
728         * Modules/indexeddb/legacy/LegacyCursor.h:
729
730         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
731         (WebCore::LegacyDatabase::createObjectStore):
732         (WebCore::LegacyDatabase::deleteObjectStore):
733         (WebCore::LegacyDatabase::transaction):
734         (WebCore::LegacyDatabase::forceClose):
735         * Modules/indexeddb/legacy/LegacyDatabase.h:
736
737         * Modules/indexeddb/legacy/LegacyFactory.cpp:
738         (WebCore::LegacyFactory::cmp):
739         * Modules/indexeddb/legacy/LegacyFactory.h:
740
741         * Modules/indexeddb/legacy/LegacyIndex.cpp:
742         (WebCore::LegacyIndex::openCursor):
743         (WebCore::LegacyIndex::count):
744         (WebCore::LegacyIndex::openKeyCursor):
745         (WebCore::LegacyIndex::get):
746         (WebCore::LegacyIndex::getKey):
747         * Modules/indexeddb/legacy/LegacyIndex.h:
748
749         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
750         (WebCore::LegacyObjectStore::get):
751         (WebCore::LegacyObjectStore::add):
752         (WebCore::LegacyObjectStore::put):
753         (WebCore::LegacyObjectStore::deleteFunction):
754         (WebCore::LegacyObjectStore::clear):
755         (WebCore::LegacyObjectStore::createIndex):
756         (WebCore::LegacyObjectStore::index):
757         (WebCore::LegacyObjectStore::deleteIndex):
758         (WebCore::LegacyObjectStore::openCursor):
759         (WebCore::LegacyObjectStore::count):
760         * Modules/indexeddb/legacy/LegacyObjectStore.h:
761         (WebCore::LegacyObjectStore::createIndex):
762         (WebCore::LegacyObjectStore::count):
763
764         * Modules/indexeddb/legacy/LegacyRequest.cpp:
765         (WebCore::LegacyRequest::result):
766         (WebCore::LegacyRequest::error):
767         (WebCore::LegacyRequest::dispatchEvent):
768         (WebCore::LegacyRequest::uncaughtExceptionInEventHandler):
769         * Modules/indexeddb/legacy/LegacyRequest.h:
770
771         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
772         (WebCore::LegacyTransaction::objectStore):
773         (WebCore::LegacyTransaction::abort):
774         (WebCore::LegacyTransaction::stop):
775         * Modules/indexeddb/legacy/LegacyTransaction.h:
776
777         * bindings/js/JSDOMBinding.cpp:
778         (WebCore::createDOMException): For IDBDatabase exceptions, use createWithDescriptionAsMessage
779
780         * bindings/js/JSIDBDatabaseCustom.cpp:
781         (WebCore::JSIDBDatabase::createObjectStore):
782         (WebCore::JSIDBDatabase::transaction):
783
784         * bindings/js/JSIDBObjectStoreCustom.cpp:
785         (WebCore::putOrAdd):
786         (WebCore::JSIDBObjectStore::createIndex):
787
788         * dom/DOMCoreException.h:
789         (WebCore::DOMCoreException::createWithDescriptionAsMessage): Create an exception whose message
790           is the description.
791         (WebCore::DOMCoreException::DOMCoreException):
792
793         * dom/ExceptionBase.cpp:
794         (WebCore::ExceptionBase::ExceptionBase): Add a flag to determine where the message comes from
795         * dom/ExceptionBase.h:
796
797         * dom/make_dom_exceptions.pl:
798         (generateHeader): Add an IDBDatabaseException type
799
800         * inspector/InspectorIndexedDBAgent.cpp:
801
802 2015-12-04  Joseph Pecoraro  <pecoraro@apple.com>
803
804         Web Inspector: Remove untested and unused Worker inspection
805         https://bugs.webkit.org/show_bug.cgi?id=151848
806
807         Reviewed by Brian Burg.
808
809         * CMakeLists.txt:
810         * WebCore.vcxproj/WebCore.vcxproj:
811         * WebCore.vcxproj/WebCore.vcxproj.filters:
812         * WebCore.xcodeproj/project.pbxproj:
813         * bindings/js/JSBindingsAllInOne.cpp:
814         * bindings/js/WorkerScriptController.cpp:
815         * bindings/js/WorkerScriptDebugServer.cpp: Removed.
816         * bindings/js/WorkerScriptDebugServer.h: Removed.
817         * inspector/InspectorAllInOne.cpp:
818         * inspector/InspectorConsoleInstrumentation.h:
819         (WebCore::InspectorInstrumentation::addMessageToConsole):
820         * inspector/InspectorController.cpp:
821         (WebCore::InspectorController::InspectorController): Deleted.
822         * inspector/InspectorInstrumentation.cpp:
823         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStartImpl): Deleted.
824         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScopeImpl): Deleted.
825         (WebCore::InspectorInstrumentation::willEvaluateWorkerScript): Deleted.
826         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminatedImpl): Deleted.
827         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
828         (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): Deleted.
829         * inspector/InspectorInstrumentation.h:
830         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
831         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart): Deleted.
832         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScope): Deleted.
833         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminated): Deleted.
834         * inspector/InspectorTimelineAgent.h:
835         * inspector/InspectorWebAgentBase.h:
836         (WebCore::WorkerAgentContext::WorkerAgentContext): Deleted.
837         * inspector/InspectorWorkerAgent.cpp: Removed.
838         * inspector/InspectorWorkerAgent.h: Removed.
839         * inspector/InspectorWorkerResource.h: Removed.
840         * inspector/InstrumentingAgents.cpp:
841         (WebCore::InstrumentingAgents::reset): Deleted.
842         * inspector/InstrumentingAgents.h:
843         (WebCore::InstrumentingAgents::workerRuntimeAgent): Deleted.
844         (WebCore::InstrumentingAgents::setWorkerRuntimeAgent): Deleted.
845         (WebCore::InstrumentingAgents::inspectorWorkerAgent): Deleted.
846         (WebCore::InstrumentingAgents::setInspectorWorkerAgent): Deleted.
847         * inspector/PageConsoleAgent.h:
848         * inspector/PageScriptDebugServer.cpp:
849         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
850         * inspector/WorkerConsoleAgent.cpp: Removed.
851         * inspector/WorkerConsoleAgent.h: Removed.
852         * inspector/WorkerDebuggerAgent.cpp: Removed.
853         * inspector/WorkerDebuggerAgent.h: Removed.
854         * inspector/WorkerInspectorController.cpp: Removed.
855         * inspector/WorkerInspectorController.h: Removed.
856         * inspector/WorkerRuntimeAgent.cpp: Removed.
857         * inspector/WorkerRuntimeAgent.h: Removed.
858         * workers/Worker.cpp:
859         (WebCore::Worker::notifyFinished): Deleted.
860         * workers/WorkerGlobalScope.cpp:
861         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Deleted.
862         (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Deleted.
863         * workers/WorkerGlobalScope.h:
864         (WebCore::WorkerGlobalScope::workerInspectorController): Deleted.
865         * workers/WorkerGlobalScopeProxy.h:
866         (WebCore::WorkerGlobalScopeProxy::PageInspector::~PageInspector): Deleted.
867         (WebCore::WorkerGlobalScopeProxy::connectToInspector): Deleted.
868         (WebCore::WorkerGlobalScopeProxy::disconnectFromInspector): Deleted.
869         (WebCore::WorkerGlobalScopeProxy::sendMessageToInspector): Deleted.
870         * workers/WorkerMessagingProxy.cpp:
871         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Deleted.
872         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Deleted.
873         (WebCore::WorkerMessagingProxy::connectToInspector): Deleted.
874         (WebCore::WorkerMessagingProxy::disconnectFromInspector): Deleted.
875         (WebCore::WorkerMessagingProxy::sendMessageToInspector): Deleted.
876         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal): Deleted.
877         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope): Deleted.
878         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
879         * workers/WorkerMessagingProxy.h:
880         * workers/WorkerReportingProxy.h:
881         * workers/WorkerThread.cpp:
882         (WebCore::WorkerThread::workerThread): Deleted.
883
884 2015-12-03  Sergio Villar Senin  <svillar@igalia.com>
885
886         [css-grid] Fix height computation of grid items with borders inside fr tracks
887         https://bugs.webkit.org/show_bug.cgi?id=151798
888
889         Reviewed by Zalan Bujtas.
890
891         Since r192154 we run a second pass of the track sizing
892         algorithm whenever the height of the grid is indefinite in
893         order to properly compute row sizes. The available space
894         passed to the track sizing algorithm must not contain neither
895         borders nor paddings, otherwise it will think that it has more
896         space available than the existing one. We should use the
897         height of the content box instead.
898
899         Test: fast/css-grid-layout/grid-item-with-border-in-fr.html
900
901         * rendering/RenderGrid.cpp:
902         (WebCore::RenderGrid::layoutBlock):
903
904 2015-12-03  Brady Eidson  <beidson@apple.com>
905
906         Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
907         https://bugs.webkit.org/show_bug.cgi?id=151847
908
909         Reviewed by Andy Estes.
910
911         No new tests (At least one failing test now passes).
912
913         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
914         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
915         (WebCore::IDBServer::MemoryIndexCursor::currentData):
916
917 2015-12-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
918
919         Reduce uses of PassRefPtr in DOM - 1
920         https://bugs.webkit.org/show_bug.cgi?id=149788
921
922         Reviewed by Darin Adler.
923
924         As a step to purge PassRefPtr, this patch reduces the uses in WebCore/dom.
925
926         * dom/ChildListMutationScope.cpp:
927         (WebCore::ChildListMutationAccumulator::getOrCreate):
928         * dom/ChildListMutationScope.h:
929         * dom/ClipboardEvent.cpp:
930         (WebCore::ClipboardEvent::ClipboardEvent):
931         * dom/ClipboardEvent.h:
932         * dom/CompositionEvent.cpp:
933         (WebCore::CompositionEvent::CompositionEvent):
934         (WebCore::CompositionEvent::initCompositionEvent):
935         * dom/CompositionEvent.h:
936         * dom/DOMNamedFlowCollection.cpp:
937         (WebCore::DOMNamedFlowCollection::item):
938         * dom/DOMNamedFlowCollection.h:
939         * dom/DOMStringList.h:
940         * dom/DeviceMotionController.cpp:
941         (WebCore::DeviceMotionController::getLastEvent):
942         * dom/DeviceMotionController.h:
943         * dom/DeviceOrientationController.cpp:
944         (WebCore::DeviceOrientationController::getLastEvent):
945         * dom/DeviceOrientationController.h:
946         * editing/Editor.cpp:
947         (WebCore::Editor::dispatchCPPEvent):
948         * page/DeviceController.h:
949         (WebCore::DeviceController::getLastEvent):
950
951 2015-12-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
952
953         Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
954         https://bugs.webkit.org/show_bug.cgi?id=151829
955
956         Reviewed by Simon Fraser.
957
958         Set the CTM of the GraphicsContext to its original value before changing
959         it. This is a lot cheaper than using GraphicsContextStateSaver to save the
960         whole state of the GraphicsContext and restore it back;
961
962         * rendering/RenderLayer.cpp:
963         (WebCore::RenderLayer::paintLayerByApplyingTransform):
964
965 2015-12-03  Eric Carlson  <eric.carlson@apple.com>
966
967         [MediaStream] Update MediaStreamTrack.getCapabilities
968         https://bugs.webkit.org/show_bug.cgi?id=151728
969
970         Reviewed by Jer Noble.
971
972         Test: fast/mediastream/MediaStreamTrack-getCapabilities.html
973
974         * CMakeLists.txt: Remove files deleted from the repository.
975
976         * DerivedSources.make: Ditto.
977
978         * Modules/mediastream/AllAudioCapabilities.h: Removed.
979         * Modules/mediastream/AllAudioCapabilities.idl: Removed.
980         * Modules/mediastream/AllVideoCapabilities.h: Removed.
981         * Modules/mediastream/AllVideoCapabilities.idl: Removed.
982         * Modules/mediastream/CapabilityRange.cpp: Removed.
983         * Modules/mediastream/CapabilityRange.h: Removed.
984         * Modules/mediastream/CapabilityRange.idl: Removed.
985
986         * Modules/mediastream/MediaSourceSettings.h:
987         (WebCore::MediaSourceSettings::supportsVolume): Volume is a double.
988         (WebCore::MediaSourceSettings::volume): Double.
989
990         * Modules/mediastream/MediaStreamCapabilities.cpp: Removed.
991         * Modules/mediastream/MediaStreamCapabilities.h: Removed.
992         * Modules/mediastream/MediaStreamCapabilities.idl: Removed.
993
994         * Modules/mediastream/MediaStreamTrack.cpp:
995         (WebCore::MediaStreamTrack::getCapabilities): MediaStreamCapabilities is gone, return a RealtimeMediaSourceCapabilities.
996         * Modules/mediastream/MediaStreamTrack.h:
997         * Modules/mediastream/MediaStreamTrack.idl:
998
999         * WebCore.xcodeproj/project.pbxproj: Remove files deleted from the repository.
1000         * bindings/js/JSMediaStreamTrackCustom.cpp:
1001         (WebCore::capabilityValue):
1002         (WebCore::JSMediaStreamTrack::getCapabilities): Create and return a dictionary of capatilities.
1003
1004         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
1005         (WebCore::CapabilityValueOrRange::type):
1006         (WebCore::CapabilityValueOrRange::CapabilityValueOrRange):
1007         (WebCore::CapabilityValueOrRange::rangeMin):
1008         (WebCore::CapabilityValueOrRange::rangeMax):
1009         (WebCore::CapabilityValueOrRange::value):
1010         (WebCore::RealtimeMediaSourceCapabilities::create):
1011         (WebCore::RealtimeMediaSourceCapabilities::~RealtimeMediaSourceCapabilities):
1012         (WebCore::RealtimeMediaSourceCapabilities::supportsWidth):
1013         (WebCore::RealtimeMediaSourceCapabilities::width):
1014         (WebCore::RealtimeMediaSourceCapabilities::setWidth):
1015         (WebCore::RealtimeMediaSourceCapabilities::supportsHeight):
1016         (WebCore::RealtimeMediaSourceCapabilities::height):
1017         (WebCore::RealtimeMediaSourceCapabilities::setHeight):
1018         (WebCore::RealtimeMediaSourceCapabilities::supportsFrameRate):
1019         (WebCore::RealtimeMediaSourceCapabilities::frameRate):
1020         (WebCore::RealtimeMediaSourceCapabilities::setFrameRate):
1021         (WebCore::RealtimeMediaSourceCapabilities::supportsFacingMode):
1022         (WebCore::RealtimeMediaSourceCapabilities::facingMode):
1023         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode):
1024         (WebCore::RealtimeMediaSourceCapabilities::supportsAspectRatio):
1025         (WebCore::RealtimeMediaSourceCapabilities::aspectRatio):
1026         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatio):
1027         (WebCore::RealtimeMediaSourceCapabilities::supportsVolume):
1028         (WebCore::RealtimeMediaSourceCapabilities::volume):
1029         (WebCore::RealtimeMediaSourceCapabilities::setVolume):
1030         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleRate):
1031         (WebCore::RealtimeMediaSourceCapabilities::sampleRate):
1032         (WebCore::RealtimeMediaSourceCapabilities::setSampleRate):
1033         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleSize):
1034         (WebCore::RealtimeMediaSourceCapabilities::sampleSize):
1035         (WebCore::RealtimeMediaSourceCapabilities::setSampleSize):
1036         (WebCore::RealtimeMediaSourceCapabilities::supportsEchoCancellation):
1037         (WebCore::RealtimeMediaSourceCapabilities::echoCancellation):
1038         (WebCore::RealtimeMediaSourceCapabilities::setEchoCancellation):
1039         (WebCore::RealtimeMediaSourceCapabilities::supportsDeviceId):
1040         (WebCore::RealtimeMediaSourceCapabilities::deviceId):
1041         (WebCore::RealtimeMediaSourceCapabilities::setDeviceId):
1042         (WebCore::RealtimeMediaSourceCapabilities::supportsGroupId):
1043         (WebCore::RealtimeMediaSourceCapabilities::groupId):
1044         (WebCore::RealtimeMediaSourceCapabilities::setGroupId):
1045         (WebCore::RealtimeMediaSourceCapabilities::RealtimeMediaSourceCapabilities):
1046         (WebCore::RealtimeMediaSourceCapabilityRange::RealtimeMediaSourceCapabilityRange): Deleted.
1047         (WebCore::RealtimeMediaSourceCapabilityRange::min): Deleted.
1048         (WebCore::RealtimeMediaSourceCapabilityRange::max): Deleted.
1049         (WebCore::RealtimeMediaSourceCapabilityRange::type): Deleted.
1050         (WebCore::RealtimeMediaSourceCapabilityRange::supported): Deleted.
1051         (WebCore::RealtimeMediaSourceCapabilities::sourceId): Deleted.
1052         (WebCore::RealtimeMediaSourceCapabilities::setSourceId): Deleted.
1053         (WebCore::RealtimeMediaSourceCapabilities::facingModes): Deleted.
1054         (WebCore::RealtimeMediaSourceCapabilities::setWidthRange): Deleted.
1055         (WebCore::RealtimeMediaSourceCapabilities::setHeightRange): Deleted.
1056         (WebCore::RealtimeMediaSourceCapabilities::setFrameRateRange): Deleted.
1057         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatioRange): Deleted.
1058         (WebCore::RealtimeMediaSourceCapabilities::setVolumeRange): Deleted.
1059         (WebCore::RealtimeMediaSourceCapabilities::hasVideoSource): Deleted.
1060         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource): Deleted.
1061
1062         * platform/mediastream/RealtimeMediaSourceSettings.h:
1063         (WebCore::RealtimeMediaSourceSettings::volume): Volume is a double.
1064         (WebCore::RealtimeMediaSourceSettings::setVolume): Ditt.
1065
1066         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1067         (WebCore::AVAudioCaptureSource::initializeCapabilities): Initialize volume capability.
1068
1069         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1070         (WebCore::AVMediaCaptureSource::capabilities): RealtimeMediaSourceCapabilities constructor takes
1071           supportedConstraints. sourceId -> deviceId.
1072
1073         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1074         (WebCore::AVVideoCaptureSource::initializeCapabilities): DeviceId is set by the base class.
1075
1076         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: Drive-by cleanup, remove unused code.
1077
1078         * platform/mock/MockRealtimeAudioSource.cpp:
1079         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Updated.
1080         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Ditto.
1081
1082         * platform/mock/MockRealtimeMediaSource.cpp:
1083         (WebCore::MockRealtimeMediaSource::capabilities): sourceId -> deviceId.
1084
1085         * platform/mock/MockRealtimeVideoSource.cpp:
1086         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Updated.
1087         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
1088
1089 2015-12-03  Simon Fraser  <simon.fraser@apple.com>
1090
1091         Have layer memory use consult the backing store format
1092         https://bugs.webkit.org/show_bug.cgi?id=151827
1093         rdar://problem/23746497
1094
1095         Reviewed by Dean Jackson.
1096         
1097         When computing the backing store memory size, take the pixel format into account,
1098         rather than assuming 4 bytes per pixel.
1099
1100         * platform/graphics/ca/GraphicsLayerCA.cpp:
1101         * platform/graphics/ca/PlatformCALayer.h:
1102
1103 2015-12-03  Anders Carlsson  <andersca@apple.com>
1104
1105         Remove Objective-C GC support
1106         https://bugs.webkit.org/show_bug.cgi?id=151819
1107         rdar://problem/23746991
1108
1109         Reviewed by Dan Bernstein.
1110
1111         * Configurations/Base.xcconfig:
1112         * bindings/objc/WebScriptObject.mm:
1113         (+[WebScriptObject initialize]): Deleted.
1114         (-[WebScriptObject finalize]): Deleted.
1115         * bindings/scripts/CodeGeneratorObjC.pm:
1116         (GenerateImplementation):
1117         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm:
1118         (-[DOMTestActiveDOMObject finalize]): Deleted.
1119         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
1120         (-[DOMTestCallback finalize]): Deleted.
1121         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm:
1122         (-[DOMTestCallbackFunction finalize]): Deleted.
1123         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm:
1124         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]): Deleted.
1125         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm:
1126         (-[DOMTestCustomNamedGetter finalize]): Deleted.
1127         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
1128         (-[DOMTestEventConstructor finalize]): Deleted.
1129         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm:
1130         (-[DOMTestEventTarget finalize]): Deleted.
1131         * bindings/scripts/test/ObjC/DOMTestException.mm:
1132         (-[DOMTestException finalize]): Deleted.
1133         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm:
1134         (-[DOMTestGenerateIsReachable finalize]): Deleted.
1135         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
1136         (-[DOMTestInterface finalize]): Deleted.
1137         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm:
1138         (-[DOMTestJSBuiltinConstructor finalize]): Deleted.
1139         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm:
1140         (-[DOMTestMediaQueryListListener finalize]): Deleted.
1141         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm:
1142         (-[DOMTestNamedConstructor finalize]): Deleted.
1143         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm:
1144         (-[DOMTestNondeterministic finalize]): Deleted.
1145         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1146         (-[DOMTestObj finalize]): Deleted.
1147         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm:
1148         (-[DOMTestOverloadedConstructors finalize]): Deleted.
1149         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm:
1150         (-[DOMTestOverrideBuiltins finalize]): Deleted.
1151         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
1152         (-[DOMTestSerializedScriptValueInterface finalize]): Deleted.
1153         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
1154         (-[DOMTestTypedefs finalize]): Deleted.
1155         * bindings/scripts/test/ObjC/DOMattribute.mm:
1156         (-[DOMattribute finalize]): Deleted.
1157         * bindings/scripts/test/ObjC/DOMreadonly.mm:
1158         (-[DOMreadonly finalize]): Deleted.
1159         * bridge/objc/objc_instance.mm:
1160         (ObjcInstance::virtualBegin):
1161         (allocateAutoReleasePool): Deleted.
1162         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1163         * platform/mac/SharedBufferMac.mm:
1164         (+[WebCoreSharedBufferData initialize]): Deleted.
1165         (-[WebCoreSharedBufferData finalize]): Deleted.
1166         * platform/mac/WebCoreObjCExtras.h:
1167         (WebCoreObjCFinalizeOnMainThread): Deleted.
1168
1169 2015-12-03  Zalan Bujtas  <zalan@apple.com>
1170
1171         Simple line layout: Print out simple line layout statistics for the current page from command line.
1172         https://bugs.webkit.org/show_bug.cgi?id=151806
1173
1174         Reviewed Simon Fraser.
1175
1176         com.apple.WebKit.showSimpleLineLayoutCoverage prints out a coverage summary of the current page,
1177         while com.apple.WebKit.showSimpleLineLayoutReasons lists the non-simple line layout blocks including the reasons why
1178         they are not covered.
1179
1180         No change in functionality.
1181
1182         * rendering/SimpleLineLayout.cpp:
1183         (WebCore::SimpleLineLayout::canUseForText):
1184         (WebCore::SimpleLineLayout::canUseForFontAndText):
1185         (WebCore::SimpleLineLayout::canUseForStyle):
1186         (WebCore::SimpleLineLayout::canUseForWithReason):
1187         (WebCore::SimpleLineLayout::canUseFor):
1188         (WebCore::SimpleLineLayout::printReason):
1189         (WebCore::SimpleLineLayout::printReasons):
1190         (WebCore::SimpleLineLayout::printTextForSubtree):
1191         (WebCore::SimpleLineLayout::textLengthForSubtree):
1192         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
1193         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
1194         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
1195         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1196
1197 2015-12-03  Jonathan Davis  <jond@apple.com>
1198
1199         Add WebCrypto to status page
1200         https://bugs.webkit.org/show_bug.cgi?id=151760
1201
1202         Reviewed by Timothy Hatcher.
1203
1204         * features.json:
1205
1206 2015-12-03  Keith Rollin  <krollin@apple.com>
1207
1208         [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
1209         https://bugs.webkit.org/show_bug.cgi?id=150909
1210         rdar://problem/23539673
1211
1212         Reviewed by Darin Adler.
1213
1214         When returning text to be displayed, an <option> element will return
1215         the value of a label attribute if it exists, or the text content as a
1216         fallback. The failing test concerned the display of a <select>
1217         element when it contained a sole <option> element that had a label
1218         attribute set to a single space. When displayed, various
1219         platform-specific bits of code will strip off the leading and trailing
1220         whitespace. However, when WebKit would use this text to measure how
1221         wide the <select> popup menu button should be, it would not strip off
1222         spaces, leading to the calculated width being wider than necessary.
1223         The approach taken to fix this is to strip whitespace in the label
1224         attribute before it is returned from the <option> element.
1225
1226         No new tests. fast/forms/HTMLOptionElement_label03.html had been
1227         marked as being expected to fail in TestExpectations; that test now
1228         succeeds.
1229
1230         * html/HTMLOptionElement.cpp:
1231         (WebCore::HTMLOptionElement::label):
1232
1233 2015-12-03  Sam Weinig  <sam@webkit.org>
1234
1235         Try to fix the Windows build.
1236
1237         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1238         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
1239         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
1240
1241 2015-12-03  Brady Eidson  <beidson@apple.com>
1242
1243         Modern IDB: storage/indexeddb/cursor-advance.html fails.
1244         https://bugs.webkit.org/show_bug.cgi?id=151731
1245
1246         Reviewed by Alex Christensen.
1247
1248         No new tests (At least one failing test now passes).
1249
1250         * Modules/indexeddb/IDBCursor.h:
1251         * Modules/indexeddb/IDBCursor.idl:
1252         
1253         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1254         (WebCore::IDBClient::IDBCursor::advance): Return a custom exception message for TypeError.
1255         * Modules/indexeddb/client/IDBCursorImpl.h:
1256         
1257         * Modules/indexeddb/legacy/LegacyCursor.cpp:
1258         (WebCore::LegacyCursor::advance):
1259         * Modules/indexeddb/legacy/LegacyCursor.h:
1260         
1261         * bindings/js/JSDOMBinding.cpp:
1262         (WebCore::createDOMException):
1263         (WebCore::setDOMException):
1264         * bindings/js/JSDOMBinding.h:
1265         
1266         * bindings/scripts/IDLAttributes.txt:
1267         
1268         * inspector/InspectorIndexedDBAgent.cpp:
1269
1270 2015-12-03  Brent Fulgham  <bfulgham@apple.com>
1271
1272         Allow JavaScript to iterate over plugins for local files
1273         https://bugs.webkit.org/show_bug.cgi?id=151783
1274         <rdar://problem/23692113>
1275
1276         Reviewed by Alexey Proskuryakov.
1277
1278         Test: http/tests/plugins/plugin-javascript-access.html
1279               plugins/plugin-javascript-access.html
1280
1281         * page/Page.cpp:
1282         (WebCore::Page::showAllPlugins): True if we set the debugging flag to show
1283         all plugins, or if the document's origin is from a local file.
1284         * page/Page.h:
1285
1286 2015-12-03  Jer Noble  <jer.noble@apple.com>
1287
1288         Unreviewed build-fix; missing include.
1289
1290         * html/HTMLVideoElement.cpp:
1291
1292 2015-12-03  Brady Eidson  <beidson@apple.com>
1293
1294         Modern IDB: storage/indexeddb/cursor-skip-deleted.html crashes.
1295         https://bugs.webkit.org/show_bug.cgi?id=151794
1296
1297         Reviewed by Alex Christensen.
1298
1299         STL reverse_iterators are a tricky beast.
1300         
1301         They are implemented in terms of a normal forward iterator (called the "base" iterator),
1302         and they decrement a copy of that iterator when dereferenced.
1303             
1304         So when monitoring deletes from  a std::set to check if we should invalidate our current 
1305         reverse_iterator, we were incorrectly comparing the deleted key to the value pointed by the
1306         reverse_iterator instead of its base iterator.
1307         
1308         Since the iterators in question are bidirectional, anyways, we can just use a single iterator
1309         and either increment or decrement it as needed.
1310         
1311         No new tests (At least one failing (crashing) test now passes).
1312
1313         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1314         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
1315         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
1316         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
1317         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
1318         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
1319         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
1320         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
1321         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1322         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1323         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
1324         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): Deleted.
1325         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): Deleted.
1326         (WebCore::IDBServer::MemoryObjectStoreCursor::hasIterators): Deleted.
1327         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): Deleted.
1328         (WebCore::IDBServer::MemoryObjectStoreCursor::clearIterators): Deleted.
1329         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
1330
1331 2015-12-03  Per Arne Vollan  <peavo@outlook.com>
1332
1333         [WinCairo][MediaFoundation] Main thread can block when session is destroyed.
1334         https://bugs.webkit.org/show_bug.cgi?id=151803
1335
1336         Reviewed by Alex Christensen.
1337
1338         Set flag to make sure that the scheduler thread stops when the session ends.
1339
1340         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1341         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
1342         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
1343         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
1344         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1345         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopThread):
1346
1347 2015-12-03  Jer Noble  <jer.noble@apple.com>
1348
1349         [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
1350         https://bugs.webkit.org/show_bug.cgi?id=150906
1351
1352         Reviewed by Simon Fraser.
1353
1354         When restoring the user interface when exiting PiP, we should return to Fullscreen if that
1355         is where fullscreen was initiated from. Additionally, when we "auto-PiP" by backgrounding the
1356         app in Fullscreen mode, we should "auto-un-PiP" when restoring the application to foreground.
1357
1358         Rather than have a separate method to request exiting fullscreen, entering standard fullscreen,
1359         and switching to & from PiP, add a new method setFullscreenMode() which does all three.
1360
1361         * html/HTMLVideoElement.cpp:
1362         (WebCore::presentationModeToFullscreenMode):
1363         (WebCore::HTMLVideoElement::webkitSetPresentationMode):
1364         (WebCore::HTMLVideoElement::setFullscreenMode):
1365         * html/HTMLVideoElement.h:
1366
1367         Add methods to for clients to request a specific fullscreen mode, and to query whether
1368         the page is currently visible.
1369
1370         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1371         (WebVideoFullscreenControllerContext::requestFullscreenMode):
1372         (WebVideoFullscreenControllerContext::isVisible):
1373         (WebVideoFullscreenControllerContext::requestExitFullscreen): Deleted.
1374         * platform/ios/WebVideoFullscreenModel.h:
1375         * platform/ios/WebVideoFullscreenModelVideoElement.h:
1376         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1377         (WebVideoFullscreenModelVideoElement::requestFullscreenMode):
1378         (WebVideoFullscreenModelVideoElement::isVisible):
1379         (WebVideoFullscreenModelVideoElement::requestExitFullscreen): Deleted.
1380
1381         Track whether returning from PiP should enter fullscreen, or whether foregrounding the app
1382         should cause PiP to return to fullscreen.
1383
1384         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1385         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1386         (-[WebAVPlayerLayer layoutSublayers]): Renamed from -setBounds:. -layoutSublayers is called
1387             more consistently than -setBounds:, including when a sublayer is added to the layer.
1388         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): The PiP WebAVPlayerLayer's
1389             modelVideoLayerFrame property may have been modified, so pass it back up to the fullscreen
1390             layer when exiting PiP.
1391         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Request fullscreen if we auto-PiPed.
1392         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Only recreate owned objects if they did not already exist.
1393         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): If we are in PiP mode, enter fullscreen by stopping PiP.
1394         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): requestExitFullscreen() -> requestFullscreenMode().
1395         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Animate out the fullscreen window, if exiting Fullscreen -> PiP.
1396         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Set m_shouldReturnToFullscreenAfterEnteringForeground if we auto-PiPed.
1397         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): requestExitFullscreen() -> requestFullscreenMode().
1398         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): If we are returning from PiP -> Fullscreen, do not hide the fullscreen window.
1399         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): If we are returning from PiP -> Fullscreen, show the controls and notify clients.
1400         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Animate in the fullscreen window, if returning from PiP -> Fullscreen.
1401         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Set m_shouldReturnToFullscreenWhenStoppingPiP if we are entering PiP from Fullscreen.
1402         * platform/spi/cocoa/AVKitSPI.h:
1403
1404 2015-12-02  Sam Weinig  <sam@webkit.org>
1405
1406         Promise callbacks should be called at microtask checkpoints
1407         https://bugs.webkit.org/show_bug.cgi?id=147933
1408
1409         Reviewed by Chris Dumez.
1410
1411         - Re-names MicroTaskQueue and MicroTask to MicrotaskQueue and Microtask to match the spec language.
1412         - Re-implements MicrotaskQueue and Microtask support suspended Microtasks (via the new KeepInQueue
1413           result value a Microtask can have when running) and correct behavior when Microtasks are added to
1414           the queue during a Microtask checkpoint.
1415         - MicrotaskQueue now has a mainThreadQueue() static function, replacing the old singleton() function,
1416           which can be used for the Document (non-Worker) Microtasks. For Workers, the a MicrotaskQueue 
1417           can be separately allocated for each WorkerGlobalScope (though this was not done in this change).
1418         - Adds a helper subclass of Microtask, ActiveDOMCallbackMicrotask, for Microtasks that are
1419           per-ScriptExecutationContext, and need to act as ActiveDOMCallbacks.
1420         - Re-implement Document (non-Worker) Promises on top of ActiveDOMCallbackMicrotask.
1421         - Re-implement MutationObserver delivery on top of Microtask.
1422
1423         Layout Test:
1424             fast/dom/microtask-promise-mutation-observer-order.html
1425
1426         * CMakeLists.txt:
1427         * WebCore.vcxproj/WebCore.vcxproj:
1428         * WebCore.xcodeproj/project.pbxproj:
1429         * dom/DOMAllInOne.cpp:
1430         Add new files.
1431
1432         * bindings/js/JSDOMWindowBase.cpp:
1433         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
1434         Switch to using ActiveDOMCallbackMicrotask/MicrotaskQueue rather than ScriptExecutionContext's Task mechanism
1435         for JavaScriptCore tasks.
1436
1437         * bindings/js/JSMainThreadExecState.cpp:
1438         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
1439         Perform a microtask checkpoint rather than calling MutationObserver code explicitly now that mutation observers
1440         use microtasks.
1441
1442         * dom/ActiveDOMCallbackMicrotask.cpp: Added.
1443         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
1444         (WebCore::ActiveDOMCallbackMicrotask::~ActiveDOMCallbackMicrotask):
1445         (WebCore::ActiveDOMCallbackMicrotask::run):
1446         (WebCore::ActiveDOMCallbackMicrotask::contextDestroyed):
1447         * dom/ActiveDOMCallbackMicrotask.h: Added.
1448         Add a helper subclass of Microtask which behaves like a ActiveDOMCallback (e.g. supports suspension
1449         and context destruction).
1450
1451         * dom/MicroTask.cpp: Renamed to Microtasks.cpp.
1452         * dom/MicroTask.h: Renamed to Microtasks.h.
1453         * dom/Microtasks.cpp: Renamed from Source/WebCore/dom/MicroTask.cpp.
1454         (WebCore::Microtask::removeSelfFromQueue):
1455         (WebCore::MicrotaskQueue::mainThreadQueue):
1456         (WebCore::MicrotaskQueue::append):
1457         (WebCore::MicrotaskQueue::remove):
1458         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
1459         (WebCore::MicroTaskQueue::singleton): Deleted.
1460         (WebCore::MicroTaskQueue::queueMicroTask): Deleted.
1461         (WebCore::MicroTaskQueue::runMicroTasks): Deleted.
1462         * dom/Microtasks.h: Renamed from Source/WebCore/dom/MicroTask.h.
1463         (WebCore::Microtask::~Microtask):
1464         (WebCore::MicrotaskQueue::MicrotaskQueue):
1465         (WebCore::MicrotaskQueue::~MicrotaskQueue):
1466         (WebCore::MicroTask::~MicroTask): Deleted.
1467         (WebCore::MicroTaskQueue::~MicroTaskQueue): Deleted.
1468         (WebCore::MicroTaskQueue::MicroTaskQueue): Deleted.
1469         Re-implement MicrotaskQueue and Microtask to support Microtask suspension (via the KeepInQueue result
1470         value) and correct behavior when Microtasks are queued during checkpoints.
1471
1472         * dom/MutationObserver.cpp:
1473         (WebCore::suspendedMutationObservers):
1474         (WebCore::MutationObserverMicrotask::MutationObserverMicrotask):
1475         (WebCore::MutationObserverMicrotask::~MutationObserverMicrotask):
1476         (WebCore::MutationObserverMicrotask::run):
1477         (WebCore::queueMutationObserverCompoundMicrotask):
1478         (WebCore::MutationObserver::enqueueMutationRecord):
1479         (WebCore::MutationObserver::setHasTransientRegistration):
1480         * dom/MutationObserver.h:
1481         Re-implement MutationObserver delivery on top of Microtasks.
1482
1483         * dom/ScriptRunner.cpp:
1484         (WebCore::ScriptRunner::timerFired):
1485         Remove unnecessary call to runMicroTasks().
1486
1487         * html/parser/HTMLScriptRunner.cpp:
1488         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1489         (WebCore::HTMLScriptRunner::runScript):
1490         Remove calls to MutationObserver::deliverAllMutations() now that the MicrotaskQueue will take care of it.
1491
1492         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
1493         Remove unnecessary call to runMicroTasks().
1494
1495         * testing/Internals.cpp:
1496         (WebCore::Internals::queueMicroTask):
1497         Use ActiveDOMCallbackMicrotask rather than a custom test subclass.
1498
1499         * testing/MicroTaskTest.cpp: Removed.
1500         * testing/MicroTaskTest.h: Removed.
1501         Remove custom test subclass of Microtask, just use ActiveDOMCallbackMicrotask directly.
1502
1503 2015-12-03  Brady Eidson  <beidson@apple.com>
1504
1505         Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
1506         https://bugs.webkit.org/show_bug.cgi?id=151807
1507
1508         Reviewed by Alex Christensen.
1509
1510         No new tests (Covered by changes to existing bindings tests).
1511
1512         While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
1513         two separate variables to reduce complexity.
1514         
1515         * bindings/scripts/CodeGeneratorJS.pm:
1516         (GenerateImplementation):
1517         (GenerateImplementationFunctionCall):
1518         (GenerateConstructorDefinition):
1519         (GenerateParametersCheck): Deleted.
1520         (GenerateReturnParameters): Deleted.
1521         
1522         * bindings/scripts/IDLAttributes.txt:
1523         
1524         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1525         (webkit_dom_test_obj_set_property):
1526         (webkit_dom_test_obj_get_property):
1527         (webkit_dom_test_obj_class_init):
1528         (webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
1529         (webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
1530         (webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
1531         (webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
1532         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1533         
1534         * bindings/scripts/test/JS/JSTestObj.cpp:
1535         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
1536         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
1537         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
1538         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
1539         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
1540         * bindings/scripts/test/ObjC/DOMTestObj.h:
1541         
1542         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1543         (-[DOMTestObj attrWithGetterExceptionWithMessage]):
1544         (-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
1545         (-[DOMTestObj attrWithSetterExceptionWithMessage]):
1546         (-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
1547         
1548         * bindings/scripts/test/TestObj.idl:
1549         
1550         * dom/ExceptionCode.h:
1551
1552 2015-12-03  Javier Fernandez  <jfernandez@igalia.com>
1553
1554         [css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
1555         https://bugs.webkit.org/show_bug.cgi?id=151802
1556
1557         Reviewed by Sergio Villar Senin.
1558
1559         When resolving auto margins so that they use the available space, in the
1560         corresponding axis, we must consider that there might be other specified
1561         margins. Such margins must account to determine the actual available space.
1562
1563         Test: fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html
1564
1565         * rendering/RenderGrid.cpp:
1566         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
1567         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
1568
1569 2015-12-02  Antti Koivisto  <antti@apple.com>
1570
1571         Move ResourceLoadScheduler to WebKit1
1572         https://bugs.webkit.org/show_bug.cgi?id=151743
1573
1574         Reviewed by Alex Christensen.
1575
1576         It is no longer used by WebKit2. Simplify the WebKit/WebCore interface.
1577
1578         * WebCore.xcodeproj/project.pbxproj:
1579         * dom/ContainerNode.cpp:
1580         * dom/Document.cpp:
1581         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
1582         * dom/Document.h:
1583         * loader/DocumentLoader.h:
1584         * loader/LoaderStrategy.cpp:
1585         (WebCore::LoaderStrategy::~LoaderStrategy):
1586         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender):
1587         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender):
1588         (WebCore::LoaderStrategy::resourceLoadScheduler): Deleted.
1589         (WebCore::LoaderStrategy::loadResourceSynchronously): Deleted.
1590         (WebCore::LoaderStrategy::createBlobRegistry): Deleted.
1591         (WebCore::LoaderStrategy::createPingHandle): Deleted.
1592         * loader/LoaderStrategy.h:
1593
1594             Loading functions implemented on WebKit side move to pure virtual LoaderStrategy.
1595
1596         * loader/ResourceLoadScheduler.cpp: Removed.
1597         * loader/ResourceLoadScheduler.h: Removed.
1598
1599             ResourceLoadScheduler moves to WebKit1 as WebResourceLoadScheduler.
1600
1601         * loader/ResourceLoader.cpp:
1602         (WebCore::ResourceLoader::finishNetworkLoad):
1603         (WebCore::ResourceLoader::setDefersLoading):
1604         (WebCore::ResourceLoader::frameLoader):
1605         (WebCore::ResourceLoader::willSwitchToSubstituteResource):
1606         (WebCore::ResourceLoader::willSendRequestInternal):
1607         * loader/archive/ArchiveResourceCollection.h:
1608         * loader/cache/CachedResource.cpp:
1609         (WebCore::CachedResource::load):
1610         * loader/cache/CachedResourceLoader.cpp:
1611         (WebCore::CachedResourceLoader::performPostLoadActions):
1612         (WebCore::CachedResourceLoader::incrementRequestCount):
1613         * platform/PlatformStrategies.h:
1614         (WebCore::PlatformStrategies::pluginStrategy):
1615         (WebCore::PlatformStrategies::blobRegistry):
1616
1617             Move BlobRegistry factory function here from LoaderStrategy as this allows network process to have null loaderStrategy.
1618             (it could be renamed BlobStrategy for consistency later).
1619
1620         (WebCore::PlatformStrategies::PlatformStrategies):
1621         * platform/network/BlobRegistry.cpp:
1622         (WebCore::blobRegistry):
1623         (WebCore::BlobRegistry::~BlobRegistry):
1624         * platform/network/ResourceRequestBase.h:
1625         * style/StyleResolveTree.cpp:
1626         (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
1627         (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
1628
1629 2015-12-02  Myles C. Maxfield  <mmaxfield@apple.com>
1630
1631         Unify font-variant-* with font-variant shorthand
1632         https://bugs.webkit.org/show_bug.cgi?id=149773
1633
1634         Reviewed by Darin Adler.
1635
1636         This patch makes font-variant a shorthand for the following properties:
1637         font-variant-ligatures
1638         font-variant-position
1639         font-variant-caps
1640         font-variant-numeric
1641         font-variant-alternates
1642         font-variant-east-asian
1643
1644         This is consistent with the CSS Fonts Level 3 spec.
1645
1646         This patch also migrates the "font" longhand to use the font-variant-caps
1647         property.
1648
1649         Test: fast/text/font-variant-shorthand.html
1650
1651         * css/CSSComputedStyleDeclaration.cpp:
1652         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
1653         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
1654         font-variant computed style.
1655         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
1656         the font shorthand.
1657         * css/CSSFontSelector.cpp:
1658         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
1659         of the new shorthand property).
1660         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
1661         (WebCore::CSSParser::parseValue):
1662         (WebCore::CSSParser::parseFont):
1663         (WebCore::CSSParser::parseSystemFont):
1664         (WebCore::CSSParser::parseFontVariantLigatures):
1665         (WebCore::CSSParser::parseFontVariantNumeric):
1666         (WebCore::CSSParser::parseFontVariantEastAsian):
1667         (WebCore::CSSParser::parseFontVariant):
1668         (WebCore::isValidKeywordPropertyAndValue): Deleted.
1669         (WebCore::isKeywordPropertyID): Deleted.
1670         * css/CSSParser.h:
1671         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
1672         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
1673         FontVariantEastAsian type.
1674         (WebCore::applyValueFontVariantLigatures):
1675         (WebCore::applyValueFontVariantNumeric):
1676         (WebCore::applyValueFontVariantEastAsian):
1677         * css/StyleProperties.cpp: Update to use the more specific property.
1678         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
1679         (WebCore::StyleProperties::fontValue):
1680         (WebCore::StyleProperties::asText):
1681         * css/StyleResolver.cpp: Ditto.
1682         (WebCore::StyleResolver::isValidCueStyleProperty):
1683         * editing/EditingStyle.cpp: Ditto.
1684         * editing/cocoa/HTMLConverter.mm: Ditto.
1685         (HTMLConverterCaches::propertyValueForNode):
1686         (HTMLConverter::computedAttributesForElement):
1687         * editing/ios/EditorIOS.mm: Ditto.
1688         (WebCore::Editor::removeUnchangeableStyles):
1689         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
1690         (WebCore::CanvasRenderingContext2D::font):
1691         (WebCore::CanvasRenderingContext2D::setFont):
1692         * platform/graphics/FontCache.h: Removing duplicate cache key value.
1693         (WebCore::FontDescriptionKey::makeFlagsKey):
1694         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
1695         (WebCore::FontCascade::glyphDataForCharacter):
1696         * platform/graphics/FontCascade.h: Ditto.
1697         (WebCore::FontCascade::isSmallCaps):
1698         * platform/graphics/FontDescription.cpp: Ditto.
1699         (WebCore::FontDescription::FontDescription):
1700         * platform/graphics/FontDescription.h: Ditto.
1701         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
1702         (WebCore::FontDescription::smallCaps): Deleted.
1703         (WebCore::FontDescription::setSmallCaps): Deleted.
1704         (WebCore::FontDescription::setIsSmallCaps): Deleted.
1705         (WebCore::FontDescription::operator==): Deleted.
1706         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
1707         (WebCore::computeFeatureSettingsFromVariants):
1708         * platform/text/TextFlags.h: Ditto.
1709         (WebCore::FontVariantSettings::operator==):
1710         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
1711         (WebCore::RenderText::widthFromCache):
1712
1713 2015-12-02  Alex Christensen  <achristensen@webkit.org>
1714
1715         Reduce size of ScriptElement
1716         https://bugs.webkit.org/show_bug.cgi?id=151786
1717
1718         Reviewed by Andreas Kling.
1719
1720         * dom/ScriptElement.cpp:
1721         (WebCore::ScriptElement::ScriptElement):
1722         (WebCore::ScriptElement::requestScript):
1723         * dom/ScriptElement.h:
1724         Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used.
1725         Use bit fields for the boolean values to save another 8 bytes per ScriptElement.
1726         This reduces sizeof(ScriptElement) from 168 to 48 bytes.
1727
1728 2015-12-02  Alex Christensen  <achristensen@webkit.org>
1729
1730         Asynchronously call onerror when a content blocker blocks ascript element's load
1731         https://bugs.webkit.org/show_bug.cgi?id=151649
1732
1733         Reviewed by Brady Eidson.
1734
1735         Test: http/tests/contentextensions/script-onerror.html
1736
1737         * dom/ScriptElement.cpp:
1738         (WebCore::ScriptElement::ScriptElement):
1739         (WebCore::ScriptElement::requestScript):
1740         * dom/ScriptElement.h:
1741
1742 2015-12-02  Jer Noble  <jer.noble@apple.com>
1743
1744         [iOS] Abrupt transition between Fullscreen -> PiP
1745         https://bugs.webkit.org/show_bug.cgi?id=151719
1746
1747         Reviewed by Eric Carlson.
1748
1749         Follow-up to r192922: When moving from inline -> PiP, don't forget to hide the fullscreen
1750         window once the PiP transition completes.
1751
1752         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1753         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
1754
1755 2015-12-02  Commit Queue  <commit-queue@webkit.org>
1756
1757         Unreviewed, rolling out r192955.
1758         https://bugs.webkit.org/show_bug.cgi?id=151776
1759
1760         A large number of the tests added with this change are failing
1761         on Windows (Requested by ryanhaddad on #webkit).
1762
1763         Reverted changeset:
1764
1765         "[css border] border-image doesn't honor border-style"
1766         https://bugs.webkit.org/show_bug.cgi?id=99922
1767         http://trac.webkit.org/changeset/192955
1768
1769 2015-12-02  Yoav Weiss  <yoav@yoav.ws>
1770
1771         Fix preloader issue with srcdoc documents.
1772         https://bugs.webkit.org/show_bug.cgi?id=151744
1773
1774         Reviewed by Ryosuke Niwa.
1775
1776         Make sure that PreloadRequest is resolving URLs based on the document's
1777         baseURL() rather than using url() as the base URL, which is not how URLs
1778         are resolved by the parser, and fails when document->url() diverges from
1779         the document's base URL (e.g. in the case of srcdoc based documents).
1780
1781         Test: fast/preloader/iframe-srcdoc.html
1782
1783         * html/parser/HTMLResourcePreloader.cpp:
1784         (WebCore::PreloadRequest::completeURL):
1785
1786 2015-12-02  Jer Noble  <jer.noble@apple.com>
1787
1788         Add a setting and restriction which will pause invisible autoplaying video
1789         https://bugs.webkit.org/show_bug.cgi?id=151412
1790
1791         Reviewed by Eric Carlson.
1792
1793         Test: media/video-restricted-invisible-autoplay-not-allowed.html
1794
1795         Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
1796         calls did not originate from an explicit request to pause or play, e.g., during an interruption.
1797         This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
1798         interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
1799         restore it when an interruption ends.
1800
1801         Add a means to register for viewport visibility notifications to FrameView, RenderView,
1802         and RenderElement. Elements who wish to recieve these notifications must do so through their
1803         renderer, and thus will have to re-register whenever a new renderer is attached.
1804
1805         Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
1806         out of the viewport, or is hidden with CSS.
1807
1808         Add a setting which controls whether that new restriction is set.
1809
1810         * dom/Element.h:
1811         (WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
1812         * html/HTMLMediaElement.cpp:
1813         (WebCore::HTMLMediaElement::HTMLMediaElement):
1814         (WebCore::HTMLMediaElement::didMoveToNewDocument):
1815         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
1816         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
1817         (WebCore::HTMLMediaElement::resumeAutoplaying):
1818         (WebCore::mediaElementIsAllowedToAutoplay):
1819         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
1820         (WebCore::HTMLMediaElement::updateShouldAutoplay):
1821         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
1822         (WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
1823         (WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
1824         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
1825         (WebCore::HTMLMediaElement::removedFrom): Ditto.
1826         (WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
1827         (WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
1828         (WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
1829         (WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
1830         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
1831         (WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
1832         (WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
1833         (WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
1834         * html/HTMLMediaElement.h:
1835         * html/MediaElementSession.cpp:
1836         (WebCore::restrictionName): Added support for new restriction.
1837         * html/MediaElementSession.h:
1838         * page/FrameView.cpp:
1839         (WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
1840         * page/Settings.in:
1841         * platform/audio/PlatformMediaSession.cpp:
1842         (WebCore::stateName): Add new "Autoplay" state.
1843         (WebCore::interruptionName): Added new interruption type.
1844         (WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
1845         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
1846         * platform/audio/PlatformMediaSession.h:
1847         (WebCore::PlatformMediaSession::interruptionType): Added getter.
1848         (WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
1849         * platform/audio/PlatformMediaSessionManager.cpp:
1850         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
1851         * rendering/RenderElement.cpp:
1852         (WebCore::RenderElement::RenderElement): Set new ivars.
1853         (WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
1854         (WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
1855         (WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
1856         (WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
1857         * rendering/RenderElement.h:
1858         * rendering/RenderView.cpp:
1859         (WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
1860         (WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
1861         (WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
1862         * rendering/RenderView.h:
1863         * testing/Internals.cpp:
1864         (WebCore::Internals::setMediaElementRestrictions): Support new restriction.
1865
1866 2015-12-02  Brady Eidson  <beidson@apple.com>
1867
1868         Modern IDB: IDBTransaction::error is not exposed.
1869         https://bugs.webkit.org/show_bug.cgi?id=151752
1870
1871         Reviewed by Alex Christensen.
1872
1873         No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
1874
1875         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1876         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1877         (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
1878         * Modules/indexeddb/client/IDBRequestImpl.h:
1879         
1880         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1881         (WebCore::IDBClient::IDBTransaction::error):
1882         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
1883         (WebCore::IDBClient::IDBTransaction::abort):
1884         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
1885         * Modules/indexeddb/client/IDBTransactionImpl.h:
1886
1887 2015-12-02  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1888
1889         [css border] border-image doesn't honor border-style
1890         https://bugs.webkit.org/show_bug.cgi?id=99922
1891
1892         Reviewed by Simon Fraser.
1893
1894         Ensure that WebKit will be compliant to css-backgrounds spec where a
1895         border with an image will only be rendered if there is a style defined.
1896
1897         Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
1898         Reference: http://www.w3.org/TR/css3-background/#border-style
1899
1900         From W3C discussion: "The fact that these properties set the style of the border is
1901         normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html
1902
1903         Test: fast/borders/border-image-should-not-display.html
1904
1905         * rendering/style/BorderData.h:
1906         (WebCore::BorderData::hasBorder):
1907         (WebCore::BorderData::borderLeftWidth):
1908         (WebCore::BorderData::borderRightWidth):
1909         (WebCore::BorderData::borderTopWidth):
1910         (WebCore::BorderData::borderBottomWidth):
1911         * rendering/style/BorderValue.h:
1912         (WebCore::BorderValue::nonZero):
1913         (WebCore::BorderValue::isVisible):
1914
1915 2015-12-02  Eric Carlson  <eric.carlson@apple.com>
1916
1917         [MediaStream] Implement MediaStreamTrack.getSettings()
1918         https://bugs.webkit.org/show_bug.cgi?id=151727
1919
1920         Reviewed by Jer Noble.
1921
1922         MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings. 
1923
1924         Test: fast/mediastream/MediaStreamTrack-getSettings.html
1925
1926         * CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
1927         * DerivedSources.make: No more MediaSourceStates.idl.
1928         * Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
1929         * Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
1930         (WebCore::MediaSourceSettings::create):
1931         (WebCore::MediaSourceSettings::MediaSourceSettings):
1932         (WebCore::MediaSourceSettings::facingMode):
1933         (WebCore::MediaSourceStates::create): Deleted.
1934         (WebCore::MediaSourceStates::MediaSourceStates): Deleted.
1935         (WebCore::MediaSourceStates::sourceType): Deleted.
1936         (WebCore::MediaSourceStates::facingMode): Deleted.
1937         * Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.
1938
1939         MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
1940         * Modules/mediastream/MediaSourceStates.cpp: Removed.
1941         * Modules/mediastream/MediaSourceStates.h: Removed.
1942         * Modules/mediastream/MediaSourceStates.idl: Removed.
1943
1944         * Modules/mediastream/MediaStreamCapabilities.cpp:
1945         (WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
1946           by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
1947         (WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
1948         (WebCore::MediaStreamCapabilities::facingMode): Ditto.
1949
1950         * Modules/mediastream/MediaStreamTrack.cpp:
1951         (WebCore::MediaStreamTrack::getSettings): New.
1952         (WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
1953           private track returns.
1954         (WebCore::MediaStreamTrack::trackSettingsChanged):
1955         (WebCore::MediaStreamTrack::states): Deleted.
1956         (WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
1957         * Modules/mediastream/MediaStreamTrack.h:
1958         * Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.
1959
1960         * Modules/webaudio/MediaStreamAudioSource.cpp:
1961         (WebCore::MediaStreamAudioSource::settings):
1962         (WebCore::MediaStreamAudioSource::states): Deleted.
1963         * Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.
1964
1965         * WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.
1966
1967         * bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
1968         * bindings/js/JSMediaStreamTrackCustom.cpp: Added.
1969         (WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so 
1970           it has to be generated manually.
1971
1972         * platform/mediastream/MediaStreamPrivate.cpp:
1973         (WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
1974         (WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
1975         * platform/mediastream/MediaStreamPrivate.h:
1976
1977         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1978         (WebCore::MediaStreamTrackPrivate::settings):
1979         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
1980         (WebCore::MediaStreamTrackPrivate::states): Deleted.
1981         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
1982         * platform/mediastream/MediaStreamTrackPrivate.h:
1983
1984         * platform/mediastream/RealtimeMediaSource.cpp:
1985         (WebCore::RealtimeMediaSource::settingsDidChanged):
1986         (WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
1987         * platform/mediastream/RealtimeMediaSource.h:
1988
1989         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
1990         (WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
1991         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
1992         (WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
1993         (WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
1994         (WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.
1995
1996         * platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
1997         * platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
1998         (WebCore::RealtimeMediaSourceSettings::facingMode):
1999         (WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
2000         (WebCore::RealtimeMediaSourceStates::sourceType): Deleted.
2001
2002         * platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
2003         * platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.
2004
2005         * platform/mediastream/RealtimeMediaSourceStates.h: Removed.
2006         * platform/mediastream/mac/AVAudioCaptureSource.h:
2007         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2008         (WebCore::AVAudioCaptureSource::updateStates): Deleted.
2009
2010         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2011         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2012
2013         * platform/mediastream/mac/AVMediaCaptureSource.h:
2014         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2015         (WebCore::AVMediaCaptureSource::states): Deleted.
2016
2017         * platform/mediastream/mac/AVVideoCaptureSource.h:
2018         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2019         (WebCore::AVVideoCaptureSource::updateStates): Deleted.
2020
2021         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2022
2023         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
2024
2025         * platform/mock/MockRealtimeAudioSource.cpp:
2026         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
2027         (WebCore::MockRealtimeAudioSource::updateStates): Deleted.
2028         * platform/mock/MockRealtimeAudioSource.h:
2029
2030         * platform/mock/MockRealtimeMediaSource.cpp:
2031         (WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
2032         (WebCore::MockRealtimeMediaSource::settings):
2033         (WebCore::MockRealtimeMediaSource::supportedConstraints):
2034         (WebCore::MockRealtimeMediaSource::states): Deleted.
2035         * platform/mock/MockRealtimeMediaSource.h:
2036         (WebCore::MockRealtimeMediaSource::constraints):
2037         (WebCore::MockRealtimeMediaSource::currentStates): Deleted.
2038
2039         * platform/mock/MockRealtimeVideoSource.cpp:
2040         (WebCore::MockRealtimeVideoSource::updateSettings):
2041         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
2042         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
2043         (WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
2044         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
2045         (WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
2046         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2047         (WebCore::MockRealtimeVideoSource::updateStates): Deleted.
2048         (WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
2049         * platform/mock/MockRealtimeVideoSource.h:
2050
2051 2015-11-30  David Hyatt  <hyatt@apple.com>
2052
2053         Implement the picture element.
2054         https://bugs.webkit.org/show_bug.cgi?id=116963
2055
2056         Reviewed by Dean Jackson.
2057
2058         Added fast/picture tests.
2059
2060         * WebCore.xcodeproj/project.pbxproj:
2061         Add HTMLPictureElement.* to the project.
2062
2063         * html/HTMLImageElement.cpp:
2064         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2065         Remove the CURRENT_SRC ifdef.
2066
2067         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2068         New helper function that checks the <source> elements of a <picture> parent
2069         for the best match.
2070
2071         (WebCore::HTMLImageElement::selectImageSource):
2072         Pull out the process of image selection into its own function so that this can
2073         be called from many places (to ensure that dynamic changes are reflected as elements
2074         get changed, added or removed).
2075
2076         (WebCore::HTMLImageElement::parseAttribute):
2077         Call selectImageSource when attributes change.
2078
2079         (WebCore::HTMLImageElement::insertedInto):
2080         If inserted into a picture element, make sure to update the source.
2081
2082         * html/HTMLImageElement.h:
2083         (WebCore::HTMLImageElement::currentSrc):
2084         Remove the CURRENT_SRC ifdef.
2085
2086         * html/HTMLImageElement.idl:
2087         Remove the CURRENT_SRC ifdef.
2088
2089         * html/HTMLPictureElement.cpp: Added.
2090         (WebCore::HTMLPictureElement::HTMLPictureElement):
2091         (WebCore::HTMLPictureElement::create):
2092         (WebCore::HTMLPictureElement::sourcesChanged):
2093         * html/HTMLPictureElement.h: Added.
2094         The new picture element. Has a sourcesChanged() function that is invoked whenever anything
2095         about the <source> elements changes.
2096
2097         * html/HTMLSourceElement.cpp:
2098         (WebCore::HTMLSourceElement::insertedInto):
2099         (WebCore::HTMLSourceElement::removedFrom):
2100         (WebCore::HTMLSourceElement::parseAttribute):
2101         Make sure to call sourcesChanged when new sources come and go or when attributes on
2102         source elements change.
2103
2104         * html/HTMLSourceElement.h:
2105         Added parseAttribute function so we can see when attributes change that force us to
2106         do a dynamic update.
2107
2108         * html/HTMLTagNames.in:
2109         Add the picture element.
2110
2111         * html/parser/HTMLSrcsetParser.h:
2112         (WebCore::ImageCandidate::srcOrigin):
2113         (WebCore::ImageCandidate::isEmpty):
2114         Some helpers for picture parsing.
2115
2116 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
2117
2118         [WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
2119         https://bugs.webkit.org/show_bug.cgi?id=151757
2120
2121         Reviewed by Alex Christensen.
2122
2123         We need to make sure we use the same bitmap format as in the Direct3D surface
2124         in video memory when copying surface data and rendering with Cairo.
2125
2126         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2127         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
2128         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2129
2130 2015-12-02  Brady Eidson  <beidson@apple.com>
2131
2132         Modern IDB: Get rid of IDBExceptionCode.
2133         https://bugs.webkit.org/show_bug.cgi?id=151753
2134
2135         Reviewed by Alex Christensen.
2136
2137         No new tests (No change in behavior).
2138
2139         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2140         (WebCore::IDBClient::IDBIndex::count):
2141         (WebCore::IDBClient::IDBIndex::doCount):
2142         (WebCore::IDBClient::IDBIndex::get):
2143         (WebCore::IDBClient::IDBIndex::doGet):
2144         (WebCore::IDBClient::IDBIndex::getKey):
2145         (WebCore::IDBClient::IDBIndex::doGetKey):
2146         
2147         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2148         (WebCore::IDBClient::IDBObjectStore::get):
2149         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2150         (WebCore::IDBClient::IDBObjectStore::clear):
2151         (WebCore::IDBClient::IDBObjectStore::createIndex):
2152         (WebCore::IDBClient::IDBObjectStore::index):
2153         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
2154         (WebCore::IDBClient::IDBObjectStore::count):
2155         (WebCore::IDBClient::IDBObjectStore::doCount):
2156         
2157         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2158         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
2159         
2160         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2161         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
2162         
2163         * Modules/indexeddb/server/IndexValueStore.cpp:
2164         (WebCore::IDBServer::IndexValueStore::addRecord):
2165         
2166         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2167         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
2168         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
2169         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
2170         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
2171         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
2172         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
2173         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
2174         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
2175         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
2176         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2177         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2178         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
2179         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
2180         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
2181         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
2182         
2183         * Modules/indexeddb/server/MemoryIndex.cpp:
2184         (WebCore::IDBServer::MemoryIndex::putIndexKey):
2185         
2186         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2187         (WebCore::IDBServer::MemoryObjectStore::createIndex):
2188         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
2189         
2190         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2191         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
2192         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2193         
2194         * Modules/indexeddb/shared/IDBError.cpp:
2195         (WebCore::IDBError::IDBError):
2196         (WebCore::IDBError::name):
2197         (WebCore::IDBError::message):
2198         (WebCore::idbErrorName): Deleted.
2199         (WebCore::idbErrorDescription): Deleted.
2200         
2201         * Modules/indexeddb/shared/IDBError.h:
2202         (WebCore::IDBError::code):
2203         (WebCore::IDBError::isNull):
2204
2205 2015-12-02  Jiewen Tan  <jiewen_tan@apple.com>
2206
2207         Null dereference loading Blink layout test fast/loader/unload-mutation-crash.html
2208         https://bugs.webkit.org/show_bug.cgi?id=149305
2209         <rdar://problem/22747892>
2210
2211         Reviewed by Brent Fulgham.
2212
2213         Add an extra guard to replaceDocument() against rude JS in unload event handlers.
2214
2215         Test: fast/loader/unload-mutation-crash.html
2216
2217         * loader/DocumentWriter.cpp:
2218         (WebCore::DocumentWriter::replaceDocument):
2219         (WebCore::DocumentWriter::begin):
2220
2221 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
2222
2223         [WinCairo] Compile error.
2224         https://bugs.webkit.org/show_bug.cgi?id=151742
2225
2226         Reviewed by Csaba Osztrogonác.
2227
2228         System font flag has moved from Font class to FontData class.
2229
2230         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
2231         (WebCore::Font::platformInit):
2232
2233 2015-12-01  Commit Queue  <commit-queue@webkit.org>
2234
2235         Unreviewed, rolling out r192894 and r192904.
2236         https://bugs.webkit.org/show_bug.cgi?id=151738
2237
2238         Crashes sometimes on Windows (Requested by litherum on
2239         #webkit).
2240
2241         Reverted changesets:
2242
2243         "[Win] Web fonts with small caps have excess whitespace with
2244         the complex text codepath"
2245         https://bugs.webkit.org/show_bug.cgi?id=151698
2246         http://trac.webkit.org/changeset/192894
2247
2248         "Test gardening after r192894"
2249         http://trac.webkit.org/changeset/192904
2250
2251 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2252
2253         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
2254         https://bugs.webkit.org/show_bug.cgi?id=150792
2255
2256         Reviewed by Saam Barati.
2257
2258         * Configurations/FeatureDefines.xcconfig:
2259
2260 2015-12-01  Commit Queue  <commit-queue@webkit.org>
2261
2262         Unreviewed, rolling out r192914.
2263         https://bugs.webkit.org/show_bug.cgi?id=151734
2264
2265         JSC tests for this change are failing on 32 and 64-bit bots
2266         (Requested by ryanhaddad on #webkit).
2267
2268         Reverted changeset:
2269
2270         "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
2271         enable this feature"
2272         https://bugs.webkit.org/show_bug.cgi?id=150792
2273         http://trac.webkit.org/changeset/192914
2274
2275 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2276
2277         [SVG -> OTF Converter] Force UnitsPerEm to 1000
2278         https://bugs.webkit.org/show_bug.cgi?id=151650
2279
2280         Reviewed by Antti Koivisto.
2281
2282         According to the Adobe Type 1 Font Format:
2283
2284         "Type 1 font programs generally use a 1000 to 1 scaling matrix
2285         for the definition of the relationship of character space unites
2286         to user space units."
2287
2288         Windows actually disregards the "unitsPerEm" value in the "head"
2289         table for some calculations, and hardcodes 1000 instead. In order
2290         to have consistent renderings on Windows and OS X, this patch
2291         forces all generated fonts to have a unitsPerEm of 1000, and
2292         appropriately scales all necessary values.
2293
2294         Test: svg/W3C-SVG-1.1/fonts-elem-03-b.svg
2295
2296         * svg/SVGToOTFFontConversion.cpp:
2297         (WebCore::SVGToOTFFontConverter::scaleUnitsPerEm):
2298         (WebCore::SVGToOTFFontConverter::appendHEADTable):
2299         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2300         (WebCore::SVGToOTFFontConverter::appendVORGTable):
2301         (WebCore::SVGToOTFFontConverter::appendVHEATable):
2302         (WebCore::SVGToOTFFontConverter::appendVMTXTable):
2303         (WebCore::SVGToOTFFontConverter::addKerningPair):
2304         (WebCore::CFFBuilder::CFFBuilder):
2305         (WebCore::CFFBuilder::boundingBox):
2306         (WebCore::CFFBuilder::updateBoundingBox):
2307         (WebCore::CFFBuilder::unscaledLineTo):
2308         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
2309         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2310         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
2311         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2312
2313 2015-12-01  Brady Eidson  <beidson@apple.com>
2314
2315         Give a more detailed message for TypeErrors that result from EnforceRange.
2316         https://bugs.webkit.org/show_bug.cgi?id=151725
2317
2318         Reviewed by Tim Horton.
2319
2320         No new tests (Covered by changes to existing tests).
2321
2322         * bindings/js/JSDOMBinding.cpp:
2323         (WebCore::rangeErrorString):
2324         (WebCore::enforceRange):
2325
2326 2015-12-01  Jer Noble  <jer.noble@apple.com>
2327
2328         [iOS] Abrupt transition between Fullscreen -> PiP
2329         https://bugs.webkit.org/show_bug.cgi?id=151719
2330
2331         Reviewed by Eric Carlson.
2332
2333         Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.
2334
2335         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2336         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
2337
2338 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2339
2340         Give String and AtomicString an existingHash() function
2341         https://bugs.webkit.org/show_bug.cgi?id=151717
2342
2343         Reviewed by Andreas Kling.
2344
2345         No new tests because there is no behavior change.
2346
2347         * platform/graphics/Font.cpp:
2348         (WebCore::CharacterFallbackMapKeyHash::hash):
2349
2350 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2351
2352         [Win] Build fix after r192895
2353
2354         Unreviewed.
2355
2356         * platform/graphics/FontPlatformData.h:
2357         (WebCore::FontPlatformData::isSystemFont):
2358         (WebCore::FontPlatformData::setIsSystemFont):
2359         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2360         (WebCore::Font::platformInit):
2361         (WebCore::Font::platformWidthForGlyph):
2362
2363 2015-12-01  Alexey Proskuryakov  <ap@apple.com>
2364
2365         Update bindings test results after r192903.
2366
2367         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2368         (WebCore::JSTestEventConstructorConstructor::construct):
2369
2370 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2371
2372         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
2373         https://bugs.webkit.org/show_bug.cgi?id=150792
2374
2375         Reviewed by Saam Barati.
2376
2377         * Configurations/FeatureDefines.xcconfig:
2378
2379 2015-12-01  Brady Eidson  <beidson@apple.com>
2380
2381         Add "RaisesExceptionWithMessage" IDL attribute.
2382         https://bugs.webkit.org/show_bug.cgi?id=151720
2383
2384         Reviewed by Alex Christensen.
2385
2386         No new tests (Covered by changes to existing bindings tests).
2387
2388         * bindings/scripts/CodeGeneratorJS.pm:
2389         (GenerateImplementation):
2390         (GenerateParametersCheck):
2391         (GenerateReturnParameters):
2392         (GenerateImplementationFunctionCall):
2393         (GenerateConstructorDefinition):
2394         
2395         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2396         (webkit_dom_test_obj_method_with_exception_with_message):
2397         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2398         
2399         * bindings/scripts/test/JS/JSTestObj.cpp:
2400         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
2401         
2402         * bindings/scripts/test/ObjC/DOMTestObj.h:
2403         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2404         (-[DOMTestObj methodWithExceptionWithMessage]):
2405         
2406         * bindings/scripts/test/TestObj.idl:
2407
2408 2015-12-01  Darin Adler  <darin@apple.com>
2409
2410         Fix anomaly where isMouseEvent returns false for wheel events
2411         https://bugs.webkit.org/show_bug.cgi?id=151685
2412
2413         Reviewed by Alexey Proskuryakov.
2414
2415         Back three years ago when we made WheelEvent inherit from MouseEvent,
2416         someone decided that isMouseEvent should return false for the wheel events.
2417         An audit of all the callers of isMouseEvent indicated that in almost every
2418         case, it's better to return true, so this patch does that.
2419
2420         All the other call sites that were checking isMouseEvent, here and in the
2421         higher levels of WebKit, benefit from getting true even for wheel events.
2422
2423         * bindings/objc/DOMEvents.mm:
2424         (kitClass): Use eventInterface instead of isMouseEvent to create the appropriate
2425         wrapper class.
2426
2427         * bindings/scripts/CodeGeneratorJS.pm:
2428         (GenerateConstructorDefinition): Eliminated a peculiar search and replace
2429         mistake; "stateution" instead of "execution".
2430
2431         * dom/Node.cpp:
2432         (WebCore::Node::handleLocalEvents): Add an isWheelEvent check here so that we
2433         will not ignore wheel events. This preserves behavior. A FIXME questions whether
2434         that is the behavior we want.
2435
2436         * dom/WheelEvent.cpp:
2437         (WebCore::WheelEvent::isMouseEvent): Deleted. No need to override and return false.
2438         * dom/WheelEvent.h: Ditto.
2439
2440         * html/HTMLTextAreaElement.cpp:
2441         (WebCore::HTMLTextAreaElement::defaultEventHandler): Removed unneeded checks for
2442         drag events and wheel events; both are types of mouse event, and so a single
2443         isMouseEvent check takes care of all three of these.
2444         * html/TextFieldInputType.cpp:
2445         (WebCore::TextFieldInputType::forwardEvent): Ditto.
2446
2447 2015-12-01  Alex Christensen  <achristensen@webkit.org>
2448
2449         Use Optional for matrix inverses
2450         https://bugs.webkit.org/show_bug.cgi?id=151575
2451
2452         Reviewed by Myles C. Maxfield.
2453
2454         This patch should have no change in behavior.  Some unnecessary checks are removed.
2455         There are a few places where we are no longer multiplying by the identity matrix.
2456         This should remind future coders that not all matrices are invertible.
2457
2458         * css/WebKitCSSMatrix.cpp:
2459         (WebCore::WebKitCSSMatrix::inverse):
2460         (WebCore::WebKitCSSMatrix::translate):
2461         * html/canvas/CanvasRenderingContext2D.cpp:
2462         (WebCore::CanvasRenderingContext2D::restore):
2463         (WebCore::CanvasRenderingContext2D::scale):
2464         (WebCore::CanvasRenderingContext2D::rotate):
2465         (WebCore::CanvasRenderingContext2D::translate):
2466         (WebCore::CanvasRenderingContext2D::transform):
2467         (WebCore::CanvasRenderingContext2D::setTransform):
2468         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
2469         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
2470         * platform/graphics/GraphicsContext.cpp:
2471         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
2472         * platform/graphics/ShadowBlur.cpp:
2473         (WebCore::ShadowBlur::calculateLayerBoundingRect):
2474         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2475         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2476         * platform/graphics/cg/ImageBufferCG.cpp:
2477         (WebCore::ImageBuffer::putByteArray):
2478         * platform/graphics/filters/Filter.h:
2479         (WebCore::Filter::setFilterScale):
2480         (WebCore::Filter::absoluteTransform):
2481         (WebCore::Filter::mapAbsolutePointToLocalPoint):
2482         (WebCore::Filter::renderingMode):
2483         (WebCore::Filter::setRenderingMode):
2484         * platform/graphics/texmap/TextureMapperLayer.cpp:
2485         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
2486         (WebCore::TextureMapperLayer::replicaTransform):
2487         (WebCore::TextureMapperLayer::setAnimatedFilters):
2488         (WebCore::TextureMapperLayer::mapScrollOffset):
2489         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2490         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
2491         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
2492         * platform/graphics/transforms/AffineTransform.cpp:
2493         (WebCore::AffineTransform::yScale):
2494         (WebCore::det):
2495         (WebCore::AffineTransform::isInvertible):
2496         (WebCore::AffineTransform::inverse):
2497         (WebCore::AffineTransform::det): Deleted.
2498         * platform/graphics/transforms/AffineTransform.h:
2499         * platform/graphics/transforms/TransformState.cpp:
2500         (WebCore::TransformState::mappedPoint):
2501         (WebCore::TransformState::mappedQuad):
2502         (WebCore::TransformState::mapQuad):
2503         (WebCore::TransformState::flattenWithTransform):
2504         * platform/graphics/transforms/TransformationMatrix.cpp:
2505         (WebCore::TransformationMatrix::isInvertible):
2506         (WebCore::TransformationMatrix::inverse):
2507         * platform/graphics/transforms/TransformationMatrix.h:
2508         * rendering/HitTestingTransformState.cpp:
2509         (WebCore::HitTestingTransformState::flattenWithTransform):
2510         (WebCore::HitTestingTransformState::mappedPoint):
2511         (WebCore::HitTestingTransformState::mappedQuad):
2512         (WebCore::HitTestingTransformState::mappedArea):
2513         (WebCore::HitTestingTransformState::boundsOfMappedArea):
2514         * rendering/PaintInfo.h:
2515         (WebCore::PaintInfo::applyTransform):
2516         * rendering/RenderLayer.cpp:
2517         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2518         (WebCore::RenderLayer::hitTestLayer):
2519         * rendering/svg/RenderSVGContainer.cpp:
2520         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
2521         * rendering/svg/RenderSVGForeignObject.cpp:
2522         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
2523         * rendering/svg/RenderSVGImage.cpp:
2524         (WebCore::RenderSVGImage::nodeAtFloatPoint):
2525         * rendering/svg/RenderSVGResourceClipper.cpp:
2526         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2527         * rendering/svg/RenderSVGResourceFilter.cpp:
2528         (WebCore::RenderSVGResourceFilter::postApplyResource):
2529         * rendering/svg/RenderSVGRoot.cpp:
2530         (WebCore::RenderSVGRoot::nodeAtPoint):
2531         * rendering/svg/RenderSVGShape.cpp:
2532         (WebCore::RenderSVGShape::setupNonScalingStrokeContext):
2533         (WebCore::RenderSVGShape::nodeAtFloatPoint):
2534         (WebCore::RenderSVGShape::calculateStrokeBoundingBox):
2535         * rendering/svg/RenderSVGText.cpp:
2536         (WebCore::RenderSVGText::nodeAtFloatPoint):
2537         * rendering/svg/SVGRenderSupport.cpp:
2538         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
2539         * rendering/svg/SVGRenderingContext.cpp:
2540         (WebCore::SVGRenderingContext::clipToImageBuffer):
2541         * svg/SVGLocatable.cpp:
2542         (WebCore::SVGLocatable::getTransformToElement):
2543         * svg/SVGMatrix.h:
2544         (WebCore::SVGMatrix::inverse):
2545         (WebCore::SVGMatrix::rotateFromVector):
2546
2547 2015-12-01  Tim Horton  <timothy_horton@apple.com>
2548
2549         Remove swipe snapshot before main document load if scroll position is already restored
2550         https://bugs.webkit.org/show_bug.cgi?id=151224
2551
2552         Reviewed by Darin Adler.
2553
2554         * loader/FrameLoaderClient.h:
2555         * loader/HistoryController.cpp:
2556         (WebCore::HistoryController::restoreScrollPositionAndViewState):
2557         Each time we try to restore the scroll position, see if the requested
2558         scroll position is something we can scroll to by going through ScrollView's
2559         scroll position constraint logic. If we can scroll there, tell our client
2560         (and eventually ViewGestureController) that we successfully restored the
2561         scroll position!
2562
2563 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2564
2565         [iOS] Adjacent emoji overlap each other
2566         https://bugs.webkit.org/show_bug.cgi?id=151690
2567         <rdar://problem/23430453>
2568
2569         Reviewed by Simon Fraser.
2570
2571         This is a partial revert of r188737. It turns out that only CoreText gives correct
2572         glyph advances for emoji. In r188737, I reverted the special iOS emoji processing,
2573         but also removed the logic of using CoreText for emoji advances. This patch adds
2574         the m_isEmoji boolean back, so we can tell if we need to force
2575         platformWidthForGlyph() to use CoreText.
2576
2577         This patch also performs a little bit of cleanup by moving Font's m_isSystemFont
2578         to FontPlatformData where it belongs.
2579
2580         Test: fast/text/emoji-overlap.html
2581
2582         * platform/graphics/Font.cpp:
2583         (WebCore::fillGlyphPage): Removed unnecessary argument.
2584         (WebCore::Font::Font): Deleted.
2585         * platform/graphics/Font.h: Moved getters and booleans to FontPlatformData.
2586         (WebCore::Font::hasCustomTracking): Deleted.
2587         (WebCore::Font::isSystemFont): Deleted.
2588         * platform/graphics/FontPlatformData.cpp:
2589         (WebCore::FontPlatformData::FontPlatformData): Initialize new booleans.
2590         (WebCore::FontPlatformData::operator=): Ditto.
2591         * platform/graphics/FontPlatformData.h: Getters for new booleans.
2592         (WebCore::FontPlatformData::isSystemFont):
2593         (WebCore::FontPlatformData::hasCustomTracking):
2594         (WebCore::FontPlatformData::isEmoji):
2595         * platform/graphics/GlyphPage.h: Remove unnecessary argument.
2596         * platform/graphics/cocoa/FontCocoa.mm:
2597         (WebCore::advanceForColorBitmapFont): Return an Optional instead of using an out
2598         argument.
2599         (WebCore::canUseFastGlyphAdvanceGetter): Make sure that we use CoreText if we are
2600         using the Emoji font.
2601         (WebCore::Font::platformWidthForGlyph):
2602         (WebCore::Font::platformInit): Deleted.
2603         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Deal with the new booleans.
2604         (WebCore::FontPlatformData::FontPlatformData):
2605         (WebCore::FontPlatformData::platformDataInit):
2606         (WebCore::FontPlatformData::platformDataAssign):
2607         (WebCore::FontPlatformData::setFont):
2608         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2609         (WebCore::GlyphPage::fill): Removed unnecessary argument.
2610         * platform/graphics/mac/GlyphPageMac.cpp:
2611         (WebCore::shouldUseCoreText): Use a reference instead of a pointer.
2612         (WebCore::GlyphPage::fill): Removed unnecessary argument.
2613         * platform/graphics/win/FontCGWin.cpp:
2614         (WebCore::FontCascade::drawGlyphs): Update for new location of booleans.
2615         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2616         (WebCore::GlyphPage::fill): Removed unnecessary argument.
2617         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2618         (WebCore::GlyphPage::fill): Removed unnecessary argument.
2619         * platform/graphics/win/UniscribeController.cpp:
2620         (WebCore::UniscribeController::shapeAndPlaceItem): Update for new location of
2621         booleans.
2622
2623 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
2624
2625         [Win] Web fonts with small caps have excess whitespace with the complex text codepath
2626         https://bugs.webkit.org/show_bug.cgi?id=151698
2627
2628         Reviewed by Darin Adler.
2629
2630         When performing small-caps on OS X, we bake in the smaller font size into the platform's native font
2631         object. On Windows, we currently don't do that; instead, we just change some ancillary data inside
2632         the FontPlatformData, and our advance & drawing calculations are sensitive to this ancillary data.
2633         However, in the complex text codepath, Uniscribe only takes the native font object as input, and
2634         therefore operates with the wrong font size.
2635
2636         The solution is to bake the smaller font size into the native platform font on Windows, similar to
2637         OS X. It isn't clear why we didn't do this previously, but it seems like we weren't sure that
2638         Windows would select the correct font when we provide new selection criteria. However, for web fonts,
2639         we already use the same mechanism (CreateFontIndirect()) when we create the font in the first place;
2640         therefore, this scaled font request will always work as well.
2641
2642         Test: fast/text/small-caps-complex.html
2643
2644         * platform/graphics/win/SimpleFontDataWin.cpp:
2645         (WebCore::Font::platformCreateScaledFont): Deleted.
2646
2647 2015-12-01  Brady Eidson  <beidson@apple.com>
2648
2649         Modern IDB: storage/indexeddb/create-and-remove-object-store.html fails.
2650         https://bugs.webkit.org/show_bug.cgi?id=151704
2651
2652         Reviewed by Alex Christensen.
2653
2654         No new tests (At least one previously failing test now passes).
2655
2656         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2657         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
2658
2659 2015-12-01  Brady Eidson  <beidson@apple.com>
2660
2661         Modern IDB: storage/indexeddb/basics.html fails.
2662         https://bugs.webkit.org/show_bug.cgi?id=151694
2663
2664         Reviewed by Alex Christensen.
2665
2666         No new tests (At least one failing test now passes, and covered by changes to 3 previously incorrect tests).
2667
2668         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2669         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Set the flag determining whether
2670           or not the request's transaction should be exposed to the DOM.
2671         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2672         
2673         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2674         (WebCore::IDBClient::IDBRequest::result): Throw an exception if the request is not done.
2675         (WebCore::IDBClient::IDBRequest::error): Ditto.
2676         (WebCore::IDBClient::IDBRequest::transaction): Only return the transaction to the DOM if the flag says so.
2677         * Modules/indexeddb/client/IDBRequestImpl.h:
2678         
2679         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2680         (WebCore::IDBClient::IDBTransaction::abort):
2681         (WebCore::IDBClient::IDBTransaction::commit):
2682
2683 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2684
2685         [GTK] ASSERTION FAILED: m_table running /webkit2/BackForwardList/navigation in Debug build
2686         https://bugs.webkit.org/show_bug.cgi?id=151700
2687
2688         Reviewed by Martin Robinson.
2689
2690         This happens when the frame notifies its observers that the page
2691         will be detached. The m_table that asserts is the
2692         FrameDestructionObserver HashSet. It happens when clearing the
2693         GObject DOM cache wrappers during frame destruction, and there's a
2694         Document object wrapped whose last reference is held by the DOM
2695         wrapper. In that case, the Document object is destroyed while the
2696         frame is being destroyed. Deleting the wrapper objects after the
2697         frame destruction fixes the crash.
2698
2699         * bindings/gobject/DOMObjectCache.cpp:
2700
2701 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2702
2703         [Streams API] pull function of tee should call readFromReadableStreamReader directly
2704         https://bugs.webkit.org/show_bug.cgi?id=151497
2705
2706         Reviewed by Darin Adler.
2707
2708         Covered by added test.
2709
2710         * Modules/streams/ReadableStreamInternals.js:
2711         (teeReadableStreamPullFunction): directly calling readFromReadableStreamReader.
2712
2713 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2714
2715         [Streams API] Clean-up JS built-in code using arrow functions
2716         https://bugs.webkit.org/show_bug.cgi?id=151489
2717
2718         Reviewed by Darin Adler.
2719
2720         Using arrow functions to remove need for _this.
2721         Made errorWritableStream take two parameters to simplify code and align it with the spec.
2722
2723         No change in behavior.
2724
2725         * Modules/streams/ReadableStream.js:
2726         (initializeReadableStream):
2727         * Modules/streams/WritableStream.js:
2728         (initializeWritableStream):
2729         (abort):
2730         (write):
2731         * Modules/streams/WritableStreamInternals.js:
2732         (errorWritableStream):
2733         (writableStreamAdvanceQueue):
2734         (closeWritableStream):
2735
2736 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2737
2738         [Streams API] teeReadableStream should not directly use stream.getReader()
2739         https://bugs.webkit.org/show_bug.cgi?id=151487
2740
2741         Reviewed by Darin Adler.
2742
2743         Covered by added test.
2744
2745         * Modules/streams/ReadableStreamInternals.js:
2746         (teeReadableStream): Create a @ReadableStreamReader instead of calling getReader() which may be disrupted by user scripts.
2747
2748 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2749
2750         [Streams API] streams should not directly use Number and related methods
2751         https://bugs.webkit.org/show_bug.cgi?id=151499
2752
2753         Reviewed by Darin Adler.
2754
2755         Covered by updated test.
2756
2757         Using @Number, @isFinite and @isNaN in place of Number, Number.isFinite and Number.isNaN.
2758
2759         * Modules/streams/ReadableStreamInternals.js:
2760         (enqueueInReadableStream):
2761         * Modules/streams/StreamInternals.js:
2762         (validateAndNormalizeQueuingStrategy):
2763         (enqueueValueWithSize):
2764
2765 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2766
2767         Unreviewed. Fix GTK+ build after r192849.
2768
2769         * bindings/scripts/CodeGeneratorGObject.pm:
2770         (GenerateFunction):
2771         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
2772         (webkit_dom_test_interface_supplemental_method1):
2773         (webkit_dom_test_interface_supplemental_method2):
2774         (webkit_dom_test_interface_set_supplemental_str2):
2775         (webkit_dom_test_interface_get_supplemental_node):
2776         (webkit_dom_test_interface_set_supplemental_node):
2777
2778 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2779
2780         [Streams API] Remove use of @catch for exposed promises
2781         https://bugs.webkit.org/show_bug.cgi?id=151625
2782
2783         Reviewed by Darin Adler.
2784
2785         Promise @catch is calling "then" which may be controlled by user scripts.
2786         This patch simply replaces @catch by calling @then directly.
2787
2788         Covered by modified tests.
2789
2790         * Modules/streams/ReadableStream.js:
2791         (pipeTo):
2792         * Modules/streams/ReadableStreamInternals.js:
2793         (teeReadableStream):
2794
2795 2015-11-30  Jaehun Lim  <ljaehun.lim@samsung.com>
2796
2797         Unreviewed, fix build after r192848 and r192849
2798
2799         - Rename canSuspendForPageCache to canSuspendForDocumentSuspension
2800         - Use references instead of pointers
2801
2802         * Modules/battery/BatteryManager.cpp:
2803         (WebCore::BatteryManager::canSuspendForDocumentSuspension):
2804         (WebCore::BatteryManager::canSuspendForPageCache): Deleted.
2805         * Modules/battery/BatteryManager.h:
2806         * Modules/battery/NavigatorBattery.cpp:
2807         (WebCore::NavigatorBattery::webkitBattery):
2808         * Modules/battery/NavigatorBattery.h:
2809         * Modules/gamepad/deprecated/NavigatorGamepad.cpp:
2810         (WebCore::NavigatorGamepad::webkitGetGamepads):
2811         * Modules/gamepad/deprecated/NavigatorGamepad.h:
2812         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2813         (WebCore::NavigatorContentUtils::registerProtocolHandler):
2814         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
2815         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
2816         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
2817         * Modules/vibration/NavigatorVibration.cpp:
2818         (WebCore::NavigatorVibration::vibrate):
2819         * Modules/vibration/NavigatorVibration.h:
2820
2821 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
2822
2823         Amazon.com Additional Information links aren't clickable
2824         https://bugs.webkit.org/show_bug.cgi?id=151401
2825         <rdar://problem/23454261>
2826
2827         Reviewed by Darin Adler.
2828
2829         The cause of this issue is that the painting order is different from the hittest order so we can end up
2830         with visible but unreachable content. To fix this, the executation flow of hittest has been reordered.
2831         According to the paint system, which renders the webpage from the bottom RenderLayer to the top, contents
2832         are rendered before floats. Hence, for the hittest, which determines the hitted location from top RenderLayer
2833         to the bottom, should do it reversedly. Now, hittest will first test floats then contents.
2834
2835         Test: fast/block/float/hit-test-on-overlapping-floats.html
2836
2837         * rendering/RenderBlock.cpp:
2838         (WebCore::RenderBlock::nodeAtPoint):
2839
2840 2015-11-30  Simon Fraser  <simon.fraser@apple.com>
2841
2842         Fix possible crash with animated layers in reflections
2843         https://bugs.webkit.org/show_bug.cgi?id=151689
2844         rdar://problem/23018612
2845
2846         Reviewed by Darin Adler.
2847
2848         Reflections create additional PlatformCALayers whose owner is set to the GraphicsLayerCA.
2849         Those PlatformCALayers need their owner pointer cleared out when the GraphicsLayerCA
2850         is destroyed.
2851         
2852         Tested by compositing/reflections/nested-reflection-transition.html
2853
2854         * platform/graphics/ca/GraphicsLayerCA.cpp:
2855         * platform/graphics/ca/GraphicsLayerCA.h:
2856
2857 2015-11-30  Brady Eidson  <beidson@apple.com>
2858
2859         Modern IDB: Iterating index cursors to a specific key is busted.
2860         https://bugs.webkit.org/show_bug.cgi?id=151684
2861
2862         Reviewed by Darin Adler.
2863
2864         No new tests (At least one failing test now passes).
2865
2866         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2867         (WebCore::IDBServer::MemoryIndexCursor::iterate):
2868
2869 2015-11-30  Brady Eidson  <beidson@apple.com>
2870
2871         Modern IDB: ObjectStore cursors should not be able to iterate out of their range.
2872         https://bugs.webkit.org/show_bug.cgi?id=151683
2873
2874         Reviewed by Darin Adler.
2875
2876         No new tests (Covered by at least one failing test that now passes).
2877
2878         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2879         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
2880         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
2881
2882 2015-11-30  Anders Carlsson  <andersca@apple.com>
2883
2884         CTTE autogenerated bindings code
2885         https://bugs.webkit.org/show_bug.cgi?id=151682
2886
2887         Reviewed by Darin Adler.
2888
2889         Make sure that JS bindings pass a reference to the object when calling static member functions.
2890
2891         * Modules/gamepad/NavigatorGamepad.cpp:
2892         (WebCore::NavigatorGamepad::getGamepads):
2893         * Modules/gamepad/NavigatorGamepad.h:
2894         * Modules/geolocation/NavigatorGeolocation.cpp:
2895         (WebCore::NavigatorGeolocation::geolocation):
2896         * Modules/geolocation/NavigatorGeolocation.h:
2897         * Modules/mediasource/AudioTrackMediaSource.h:
2898         (WebCore::AudioTrackMediaSource::sourceBuffer):
2899         * Modules/mediasource/TextTrackMediaSource.h:
2900         (WebCore::TextTrackMediaSource::sourceBuffer):
2901         * Modules/mediasource/VideoTrackMediaSource.h:
2902         (WebCore::VideoTrackMediaSource::sourceBuffer):
2903         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
2904         (WebCore::HTMLMediaElementMediaStream::srcObject):
2905         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
2906         * Modules/mediastream/HTMLMediaElementMediaStream.h:
2907         * Modules/mediastream/NavigatorMediaDevices.cpp:
2908         (WebCore::NavigatorMediaDevices::mediaDevices):
2909         * Modules/mediastream/NavigatorMediaDevices.h:
2910         * Modules/notifications/DOMWindowNotifications.cpp:
2911         (WebCore::DOMWindowNotifications::webkitNotifications):
2912         * Modules/notifications/DOMWindowNotifications.h:
2913         * Modules/notifications/Notification.cpp:
2914         (WebCore::Notification::Notification):
2915         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
2916         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
2917         * Modules/notifications/WorkerGlobalScopeNotifications.h:
2918         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
2919         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
2920         * Modules/speech/DOMWindowSpeechSynthesis.h:
2921         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2922         (WebCore::DOMWindowWebDatabase::openDatabase):
2923         * Modules/webdatabase/DOMWindowWebDatabase.h:
2924         * bindings/scripts/CodeGeneratorJS.pm:
2925         (GenerateImplementation):
2926         (GenerateParametersCheck):
2927         * testing/Internals.cpp:
2928         (WebCore::Internals::enableMockSpeechSynthesizer):
2929
2930 2015-11-30  Katlyn Graff  <kgraff@apple.com>
2931
2932         Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
2933         https://bugs.webkit.org/show_bug.cgi?id=151677
2934
2935         Reviewed by Ryosuke Niwa.
2936
2937         Simply a refactoring patch, so no new tests.
2938
2939         * Modules/encryptedmedia/MediaKeySession.cpp:
2940         (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
2941         (WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
2942         * Modules/encryptedmedia/MediaKeySession.h:
2943         * Modules/geolocation/Geolocation.cpp:
2944         (WebCore::Geolocation::canSuspendForDocumentSuspension):
2945         (WebCore::Geolocation::canSuspendForPageCache): Deleted.
2946         * Modules/geolocation/Geolocation.h:
2947         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2948         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
2949         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
2950         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
2951         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
2952         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
2953         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2954         (WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
2955         (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
2956         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2957         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2958         (WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
2959         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
2960         * Modules/indexeddb/client/IDBRequestImpl.h:
2961         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2962         (WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
2963         (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
2964         * Modules/indexeddb/client/IDBTransactionImpl.h:
2965         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
2966         (WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
2967         (WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
2968         * Modules/indexeddb/legacy/LegacyDatabase.h:
2969         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2970         (WebCore::LegacyRequest::canSuspendForDocumentSuspension):
2971         (WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
2972         * Modules/indexeddb/legacy/LegacyRequest.h:
2973         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
2974         (WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
2975         (WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
2976         * Modules/indexeddb/legacy/LegacyTransaction.h:
2977         * Modules/mediasource/MediaSource.cpp:
2978         (WebCore::MediaSource::canSuspendForDocumentSuspension):
2979         (WebCore::MediaSource::canSuspendForPageCache): Deleted.
2980         * Modules/mediasource/MediaSource.h:
2981         * Modules/mediasource/SourceBuffer.cpp:
2982         (WebCore::SourceBuffer::canSuspendForDocumentSuspension):
2983         (WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
2984         * Modules/mediasource/SourceBuffer.h:
2985         * Modules/mediastream/MediaStreamTrack.cpp:
2986         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
2987         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
2988         * Modules/mediastream/MediaStreamTrack.h:
2989         * Modules/mediastream/RTCDTMFSender.cpp:
2990         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
2991         (WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
2992         * Modules/mediastream/RTCDTMFSender.h:
2993         * Modules/mediastream/RTCPeerConnection.cpp:
2994         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
2995         (WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
2996         * Modules/mediastream/RTCPeerConnection.h:
2997         * Modules/notifications/DOMWindowNotifications.cpp:
2998         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
2999         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
3000         (WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
3001         (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
3002         * Modules/notifications/DOMWindowNotifications.h:
3003         * Modules/notifications/Notification.cpp:
3004         (WebCore::Notification::canSuspendForDocumentSuspension):
3005         (WebCore::Notification::canSuspendForPageCache): Deleted.
3006         * Modules/notifications/Notification.h:
3007         * Modules/notifications/NotificationCenter.cpp:
3008         (WebCore::NotificationCenter::canSuspendForDocumentSuspension):
3009         (WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
3010         * Modules/notifications/NotificationCenter.h:
3011         * Modules/webaudio/AudioContext.cpp:
3012         (WebCore::AudioContext::canSuspendForDocumentSuspension):
3013         (WebCore::AudioContext::canSuspendForPageCache): Deleted.
3014         * Modules/webaudio/AudioContext.h:
3015         * Modules/webdatabase/DatabaseContext.cpp:
3016         (WebCore::DatabaseContext::canSuspendForDocumentSuspension):
3017         (WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
3018         * Modules/webdatabase/DatabaseContext.h:
3019         * Modules/websockets/WebSocket.cpp:
3020         (WebCore::WebSocket::canSuspendForDocumentSuspension):
3021         (WebCore::WebSocket::canSuspendForPageCache): Deleted.
3022         * Modules/websockets/WebSocket.h:
3023         * css/FontLoader.cpp:
3024         (WebCore::FontLoader::canSuspendForDocumentSuspension):
3025         (WebCore::FontLoader::canSuspendForPageCache): Deleted.
3026         * css/FontLoader.h:
3027         * dom/ActiveDOMObject.cpp:
3028         (WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
3029         (WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
3030         * dom/ActiveDOMObject.h:
3031         * dom/Document.cpp:
3032         (WebCore::Document::~Document):
3033         * dom/ScriptExecutionContext.cpp:
3034         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
3035         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
3036         * dom/ScriptExecutionContext.h:
3037         * fileapi/FileReader.cpp:
3038         (WebCore::FileReader::canSuspendForDocumentSuspension):
3039         (WebCore::FileReader::canSuspendForPageCache): Deleted.
3040         * fileapi/FileReader.h:
3041         * history/CachedFrame.cpp:
3042         (WebCore::CachedFrame::CachedFrame):
3043         * history/PageCache.cpp:
3044         (WebCore::canCacheFrame):
3045         * html/HTMLMarqueeElement.cpp:
3046         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
3047         (WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
3048         * html/HTMLMarqueeElement.h:
3049         * html/HTMLMediaElement.cpp:
3050         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
3051         (WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
3052         * html/HTMLMediaElement.h:
3053         * html/HTMLSourceElement.cpp:
3054         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
3055         (WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
3056         * html/HTMLSourceElement.h:
3057         * html/PublicURLManager.cpp:
3058         (WebCore::PublicURLManager::canSuspendForDocumentSuspension):
3059         (WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
3060         * html/PublicURLManager.h:
3061         * html/canvas/WebGLRenderingContextBase.cpp:
3062         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
3063         (WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
3064         * html/canvas/WebGLRenderingContextBase.h:
3065         * loader/FrameLoader.cpp:
3066         (WebCore::FrameLoader::clear):
3067         (WebCore::FrameLoader::open):
3068         * loader/appcache/DOMApplicationCache.cpp:
3069         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
3070         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
3071         (WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
3072         (WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
3073         * loader/appcache/DOMApplicationCache.h:
3074         * page/DOMWindow.cpp:
3075         (WebCore::DOMWindow::DOMWindow):
3076         (WebCore::DOMWindow::~DOMWindow):
3077         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
3078         (WebCore::DOMWindow::suspendForDocumentSuspension):
3079         (WebCore::DOMWindow::resumeFromDocumentSuspension):
3080         (WebCore::DOMWindow::disconnectDOMWindowProperties):
3081         (WebCore::DOMWindow::reconnectDOMWindowProperties):
3082         (WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
3083         (WebCore::DOMWindow::suspendForPageCache): Deleted.
3084         (WebCore::DOMWindow::resumeFromPageCache): Deleted.
3085         * page/DOMWindow.h:
3086         * page/DOMWindowExtension.cpp:
3087         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
3088         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
3089         (WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
3090         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
3091         * page/DOMWindowExtension.h:
3092         * page/DOMWindowProperty.cpp:
3093         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
3094         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
3095         (WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
3096         (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
3097         * page/DOMWindowProperty.h:
3098         * page/EventSource.cpp:
3099         (WebCore::EventSource::canSuspendForDocumentSuspension):
3100         (WebCore::EventSource::canSuspendForPageCache): Deleted.
3101         * page/EventSource.h:
3102         * page/SuspendableTimer.cpp:
3103         (WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
3104         (WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
3105         * page/SuspendableTimer.h:
3106         * workers/Worker.cpp:
3107         (WebCore::Worker::canSuspendForDocumentSuspension):
3108         (WebCore::Worker::canSuspendForPageCache): Deleted.
3109         * workers/Worker.h:
3110         * xml/XMLHttpRequest.cpp:
3111         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
3112         (WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
3113         * xml/XMLHttpRequest.h:
3114
3115 2015-11-30  Brady Eidson  <beidson@apple.com>
3116
3117         Modern IDB: "prevunique" cursors should point at the lowest primary key that matches, not the highest.
3118         https://bugs.webkit.org/show_bug.cgi?id=151675.
3119
3120         Reviewed by Darin Adler.
3121
3122         No new tests (Covered by at least one failing test that now passes, and updates to previously incorrect tests).
3123
3124         * Modules/indexeddb/server/IndexValueEntry.cpp:
3125         (WebCore::IDBServer::IndexValueEntry::reverseBegin): If CursorDuplicity is NoDuplicates, start at the lowest
3126           entry instead of the highest.
3127         (WebCore::IDBServer::IndexValueEntry::reverseFind):
3128         * Modules/indexeddb/server/IndexValueEntry.h:
3129         
3130         * Modules/indexeddb/server/IndexValueStore.cpp:
3131         (WebCore::IDBServer::IndexValueStore::reverseFind):
3132         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
3133         (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
3134         * Modules/indexeddb/server/IndexValueStore.h:
3135         
3136         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
3137         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
3138         (WebCore::IDBServer::MemoryIndexCursor::iterate):
3139         
3140         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3141         (WebCore::IDBCursorInfo::duplicity):
3142         (WebCore::IDBCursorInfo::isDirectionNoDuplicate): Deleted.
3143         * Modules/indexeddb/shared/IDBCursorInfo.h:
3144
3145 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
3146
3147         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
3148         https://bugs.webkit.org/show_bug.cgi?id=149309
3149         <rdar://problem/22748363>
3150
3151         Reviewed by Brent Fulgham.
3152
3153         A weird order of event execution introduced by the test case will kill the webpage in a
3154         subframe of the page while executing its |frame.loader().checkLoadCompleteForThisFrame()|.
3155         Therefore, any frames comes after the failing subframe will have no page. Check it before
3156         calling to those frames' |frame.loader().checkLoadCompleteForThisFrame()|, otherwise the
3157         assertion in |frame.loader().checkLoadCompleteForThisFrame()| will fail.
3158
3159         Test: http/tests/misc/detach-during-notifyDone.html
3160
3161         * loader/FrameLoader.cpp:
3162         (WebCore::FrameLoader::checkLoadComplete):
3163
3164 2015-11-30  Commit Queue  <commit-queue@webkit.org>
3165
3166         Unreviewed, rolling out r192819.
3167         https://bugs.webkit.org/show_bug.cgi?id=151681
3168
3169         This change broke existing layout tests on Windows (Requested
3170         by ryanhaddad on #webkit).
3171
3172         Reverted changeset:
3173
3174         "Unify font-variant-* with font-variant shorthand"
3175         https://bugs.webkit.org/show_bug.cgi?id=149773
3176         http://trac.webkit.org/changeset/192819
3177
3178 2015-11-30  Darin Adler  <darin@apple.com>
3179
3180         Use Optional instead of isNull out argument for nullable getters
3181         https://bugs.webkit.org/show_bug.cgi?id=151676
3182
3183         Reviewed by Anders Carlsson.
3184
3185         No behavior change, just cleaner code.
3186
3187         * Modules/geolocation/Coordinates.cpp:
3188         (WebCore::Coordinates::altitude): Return an Optional.
3189         (WebCore::Coordinates::altitudeAccuracy): Ditto.
3190         (WebCore::Coordinates::heading): Ditto.
3191         (WebCore::Coordinates::speed): Ditto.
3192         * Modules/geolocation/Coordinates.h: Ditto.
3193
3194         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3195         (WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
3196         through to Event::create, which is clearly not what was wanted. Also removed
3197         unneeded explicit destructor.
3198         * Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
3199         to Optional and updated for above change.
3200
3201         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
3202         (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
3203         an Optional.
3204         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
3205         default argument values; the event type one, at least, was clearly incorrect.
3206         Made more things private, got rid of unneeded destructor, marked class final
3207         instead of marking all functions final.
3208
3209         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
3210         (WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
3211         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.
3212
3213         * Modules/mediastream/MediaTrackConstraints.cpp:
3214         (WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
3215         come back to finish later we will have to implement optional return values
3216         for arrays in the JavaScript bindings generator, which should be straightforward.
3217         * Modules/mediastream/MediaTrackConstraints.h: Ditto.
3218
3219         * bindings/js/JSDOMBinding.h:
3220         (WebCore::toNullableJSNumber): Added. This function template is used for
3221         return values that are nullable numbers.
3222
3223         * bindings/scripts/CodeGeneratorGObject.pm:
3224         (GenerateFunction): Replaced some existing bogus code to handle nullables with
3225         new equally-bogus code that should be no worse and will compile.
3226
3227         * bindings/scripts/CodeGeneratorJS.pm:
3228         (GenerateImplementation): Removed old support for nullables.
3229         (NativeToJSValue): Added new support for nullable numbers.
3230
3231         * bindings/scripts/CodeGeneratorObjC.pm:
3232         (GenerateImplementation): Removed support for nullables. We almost certainly
3233         won't need it for Objective-C bindings.
3234
3235         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
3236         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
3237         * bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.
3238
3239 2015-11-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3240
3241         Split platform-independent logic in AVCaptureDeviceManager out into a new class
3242         https://bugs.webkit.org/show_bug.cgi?id=151388
3243         <rdar://problem/23593980>
3244
3245         Reviewed by Eric Carlson.
3246
3247         To prepare for creating a MockCaptureDeviceManager to be able to test
3248         MediaDevices.getUserMedia, we create a platform-independent capture device manager
3249         which all platforms should extend and add platform-specific logic to.
3250
3251         The methods CaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints and
3252         CaptureDeviceManager::captureDeviceList should be overridden by each platform
3253         CaptureDeviceManager to respectively create a RealtimeMediaSource and return a list of
3254         capture devices. createMediaSourceForCaptureDeviceWithConstraints attempts to create
3255         a media source for a given device with some constraints; if the contraints cannot be
3256         satisfied, this returns null.
3257
3258         The refactored capture device manager also introduces the notion of a platform-
3259         independent capture session which may be extended by platform device managers for
3260         determining whether a given constraint name, value and media type is valid.
3261
3262         A platform-independent CaptureDeviceInfo now represents either the video or audio
3263         component of a capture device, but not both at once. This means a capture device that
3264         supports both video and audio will emit two separate capture devices.
3265
3266         No new tests, since there should be no behavior change.
3267
3268         * Modules/mediastream/CaptureDeviceInfo.h: Added.
3269         (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
3270         (WebCore::CaptureSessionInfo::supportsVideoSize):
3271         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
3272         * Modules/mediastream/CaptureDeviceManager.cpp: Added.
3273         (CaptureDeviceManager::~CaptureDeviceManager):
3274         (CaptureDeviceManager::getSourcesInfo):
3275         (CaptureDeviceManager::captureDeviceFromDeviceID):
3276         (CaptureDeviceManager::verifyConstraintsForMediaType):
3277         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
3278         (CaptureDeviceManager::sourceWithUID):
3279         (CaptureDeviceManager::bestDeviceForFacingMode):
3280         (facingModeFromString):
3281         (CaptureDeviceManager::sessionSupportsConstraint):
3282         (CaptureDeviceManager::isSupportedFrameRate):
3283         * Modules/mediastream/CaptureDeviceManager.h: Added.
3284         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList):
3285         (WebCore::CaptureDeviceManager::defaultCaptureSession):
3286         * WebCore.xcodeproj/project.pbxproj:
3287         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Added.
3288         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
3289         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName):
3290         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
3291         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
3292         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3293         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3294         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo):
3295         (WebCore::AVCaptureSessionInfo::supportsVideoSize):
3296         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions):
3297         (WebCore::AVCaptureDeviceManager::captureDeviceList):
3298         (WebCore::shouldConsiderDeviceInDeviceList):
3299         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
3300         (WebCore::AVCaptureDeviceManager::AVCaptureDeviceManager):
3301         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
3302         (WebCore::AVCaptureDeviceManager::sourceWithUID):
3303         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
3304         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType):
3305         (WebCore::AVCaptureDeviceManager::defaultCaptureSession):
3306         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint):
3307         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
3308         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
3309         (WebCore::AVCaptureDeviceManager::isSupportedFrameRate):
3310         (WebCore::CaptureDevice:::m_enabled): Deleted.
3311         (WebCore::captureDeviceList): Deleted.
3312         (WebCore::captureDeviceFromDeviceID): Deleted.
3313         (WebCore::refreshCaptureDeviceList): Deleted.
3314         (WebCore::AVCaptureDeviceManager::bestSessionPresetForVideoSize): Deleted.
3315         (WebCore::AVCaptureDeviceManager::deviceSupportsFacingMode): Deleted.
3316         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Deleted.
3317         (WebCore::AVCaptureDeviceManager::isValidConstraint): Deleted.
3318         (WebCore::AVCaptureDeviceManager::validConstraintNames): Deleted.
3319         (WebCore::AVCaptureDeviceManager::validFacingModes): Deleted.
3320         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3321         (WebCore::AVVideoCaptureSource::applyConstraints):
3322         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3323         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
3324         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
3325
3326 2015-11-30  Brady Eidson  <beidson@apple.com>
3327
3328         Modern IDB: Set the correct source on the IDBRequest for cursor updates
3329         https://bugs.webkit.org/show_bug.cgi?id=151665
3330
3331         Reviewed by Andy Estes.
3332
3333         No new tests (At least one existing failing test now passes).
3334
3335         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3336         (WebCore::IDBClient::IDBCursor::update):
3337         
3338         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3339         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
3340         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
3341         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
3342         
3343         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3344         (WebCore::IDBClient::IDBRequest::IDBRequest):
3345         (WebCore::IDBClient::IDBRequest::setSource):
3346         * Modules/indexeddb/client/IDBRequestImpl.h:
3347
3348 2015-11-30  Tim Horton  <timothy_horton@apple.com>
3349
3350         Get rid of the legacy TextIndicatorWindow style
3351         https://bugs.webkit.org/show_bug.cgi?id=151674
3352
3353         Reviewed by Anders Carlsson.
3354
3355         * page/TextIndicator.h:
3356         * page/mac/TextIndicatorWindow.mm:
3357         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Deleted.
3358
3359 2015-11-30  Brady Eidson  <beidson@apple.com>
3360
3361         Modern IDB: Correct handling of cursors finishing iteration.
3362         https://bugs.webkit.org/show_bug.cgi?id=151664
3363
3364         Reviewed by Andy Estes.
3365
3366         No new tests (At least one previously failing test now passes).
3367
3368         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3369         (WebCore::IDBClient::IDBCursor::setGetResult):
3370         
3371         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3372         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
3373
3374 2015-11-30  Myles C. Maxfield  <mmaxfield@apple.com>
3375
3376         Unify font-variant-* with font-variant shorthand
3377         https://bugs.webkit.org/show_bug.cgi?id=149773
3378
3379         Reviewed by Darin Adler.
3380
3381         This patch makes font-variant a shorthand for the following properties:
3382         font-variant-ligatures
3383         font-variant-position
3384         font-variant-caps
3385         font-variant-numeric
3386         font-variant-alternates
3387         font-variant-east-asian
3388
3389         This is consistent with the CSS Fonts Level 3 spec.
3390
3391         This patch also migrates the "font" longhand to use the font-variant-caps
3392         property.
3393
3394         Test: fast/text/font-variant-shorthand.html
3395
3396         * css/CSSComputedStyleDeclaration.cpp:
3397         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
3398         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
3399         font-variant computed style.
3400         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
3401         the font shorthand.
3402         * css/CSSFontSelector.cpp:
3403         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
3404         of the new shorthand property).
3405         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
3406         (WebCore::CSSParser::parseValue):
3407         (WebCore::CSSParser::parseFont):
3408         (WebCore::CSSParser::parseSystemFont):
3409         (WebCore::CSSParser::parseFontVariantLigatures):
3410         (WebCore::CSSParser::parseFontVariantNumeric):
3411         (WebCore::CSSParser::parseFontVariantEastAsian):
3412         (WebCore::CSSParser::parseFontVariant):
3413         (WebCore::isValidKeywordPropertyAndValue): Deleted.
3414         (WebCore::isKeywordPropertyID): Deleted.