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