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