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