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