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