[iOS] Suspend and resume device motion and device orientation updates when page is...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-09  Daniel Bates  <dabates@apple.com>
2
3         [iOS] Suspend and resume device motion and device orientation updates when page is hidden and visible, respectively
4         https://bugs.webkit.org/show_bug.cgi?id=151840
5         <rdar://problem/23753931>
6
7         Reviewed by Simon Fraser.
8
9         * dom/Document.cpp:
10         (WebCore::Document::suspendDeviceMotionAndOrientationUpdates): Added.
11         (WebCore::Document::resumeDeviceMotionAndOrientationUpdates): Added.
12         (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Moved logic to suspend device motion and
13         orientation updates from here to Document::suspendDeviceMotionAndOrientationUpdates().
14         (WebCore::Document::suspendActiveDOMObjects): Modified to call Document::suspendDeviceMotionAndOrientationUpdates().
15         (WebCore::Document::resumeActiveDOMObjects): Modified to call Document::resumeDeviceMotionAndOrientationUpdates().
16         * dom/Document.h:
17         * page/Page.cpp:
18         (WebCore::Page::setIsVisibleInternal): Suspend device motion and orientation updates when the page is hidden and
19         resume updates when the page is visible.
20         (WebCore::Page::suspendDeviceMotionAndOrientationUpdates): Added.
21         (WebCore::Page::resumeDeviceMotionAndOrientationUpdates): Added.
22         * page/Page.h:
23
24 2015-12-09  Daniel Bates  <dabates@apple.com>
25
26         Unify iOS Frame::setTimersPaused() logic and Frame::{suspend, resume}ActiveDOMObjectsAndAnimations()
27         https://bugs.webkit.org/show_bug.cgi?id=152006
28
29         Reviewed by Simon Fraser.
30
31         Currently we have almost identical logic to suspend and resume a web page for iOS and non-iOS ports.
32         We should unify this logic instead of duplicating it.
33
34         * dom/ActiveDOMObject.h: Remove iOS-specific enumeration DocumentWillBePaused and standardize on
35         enumerator PageWillBeSuspended.
36         * dom/Document.cpp:
37         (WebCore::Document::didBecomeCurrentDocumentInFrame): Unify iOS and non-iOS-specific code.
38         (WebCore::Document::suspendScheduledTasks): Ignore subsequent calls to this function so long as the reason for
39         the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent call may occur as part of
40         handling a scroll or zoom gesture.
41         * dom/ScriptExecutionContext.cpp:
42         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ignore subsequent calls to this function
43         so long as the reason for the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent
44         call may occur as part of the process of a page being added to the page cache.
45         * html/HTMLMediaElement.cpp:
46         (WebCore::HTMLMediaElement::suspend): Remove case for ActiveDOMObject::DocumentWillBePaused as this
47         enumerator is being removed.
48         * page/DOMTimer.cpp:
49         (WebCore::DOMTimer::install): Write logic that used Frame::timersPaused() terms of
50         ScriptExecutionContext::activeDOMObjectsAreSuspended() as we are removing Frame::timersPaused().
51         (WebCore::DOMTimer::fired): Remove iOS-specific assertion with respect to Frame::timersPaused().
52         This function already asserts the equivalent condition that ScriptExecutionContext::activeDOMObjectsAreSuspended()
53         evaluates to false. Clean up iOS-specific code that depends on the ScriptExecutionContext being a
54         Document object by taking advantage of the fact that this assumption is true when shouldBeginObservingChanges
55         evaluates to true.
56         * page/Frame.cpp:
57         (WebCore::Frame::Frame): Remove instance variable m_timersPausedCount and unify the iOS and non-iOS logic.
58         (WebCore::Frame::suspendActiveDOMObjectsAndAnimations): Standardize on the iOS logic for suspending
59         DOM objects and animations because it is more comprehensive on what it suspends and works with the deferred
60         loading machinery (Page::setDefersLoading() - see remarks in Frame::resumeActiveDOMObjectsAndAnimations() for
61         more details). Specifically, make use of Frame::clearTimers() to suspend non-scripted animations (i.e. non-requestAnimationFrame()
62         animations), auto-scroll timer, and pending relayouts. And use Document::suspendScheduledTasks() to suspend
63         all other tasks, including WebSQL database callbacks, active DOM objects, scripted animations and execution of
64         <script async>/<script defer> JavaScript scripts.
65         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): Standardize on the iOS logic for resuming
66         DOM objects and animations for symmetry and because it works with the deferred loading machinery. We call
67         Document::resumeScheduledTasks() (which calls Document::resumeActiveDOMObjects()) instead of calling
68         Document::resumeActiveDOMObjects() directly because the former will ultimately process the queue of pending
69         tasks (Document::m_pendingTasks).
70         * page/Frame.h: Remove instance variable m_timersPausedCount.
71         (WebCore::Frame::timersPaused): Deleted.
72         * page/ios/FrameIOS.mm:
73         (WebCore::Frame::setTimersPaused): Write this function in terms of Page::{suspend, resume}ActiveDOMObjectsAndAnimations().
74         We need to keep this function for Legacy WebKit on iOS.
75         (WebCore::Frame::setTimersPausedInternal): Deleted.
76         * rendering/RenderElement.cpp:
77         (WebCore::shouldRepaintForImageAnimation): Remove iOS-specific code to early return when Frame::timersPaused()
78         evaluates to true. This function already has the equivalent code to early return when Document::activeDOMObjectsAreSuspended()
79         evaluates to true.
80
81 2015-12-09  Brady Eidson  <beidson@apple.com>
82
83         Modern IDB: storage/indexeddb/metadata.html fails
84         https://bugs.webkit.org/show_bug.cgi?id=152099
85
86         Reviewed by Alex Christensen.
87
88         Test: storage/indexeddb/modern/abort-objectstore-info.html
89               And at least one existing failure now passes.
90
91         We did not properly reset object store info when version change transactions aborted.
92
93         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
94         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
95         (WebCore::IDBClient::IDBObjectStore::rollbackInfoForVersionChangeAbort):
96         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
97         
98         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
99         (WebCore::IDBClient::IDBTransaction::abort):
100
101 2015-12-09  Simon Fraser  <simon.fraser@apple.com>
102
103         Adjust layer backing store format
104         https://bugs.webkit.org/show_bug.cgi?id=152097
105         rdar://problem/23305376
106
107         Reviewed by Tim Horton.
108         
109         Call setBackingStoreFormat() on UIWebView tile grid layers, and on compositing
110         layers which can allocate backing store.
111
112         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
113         (WebCore::setBackingStoreFormat):
114         (PlatformCALayerCocoa::commonInit):
115         * platform/ios/LegacyTileGridTile.mm:
116         (WebCore::setBackingStoreFormat):
117         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
118
119 2015-12-09  Brady Eidson  <beidson@apple.com>
120
121         Modern IDB: storage/indexeddb/intversion-close-between-events.html fails.
122         https://bugs.webkit.org/show_bug.cgi?id=152096
123
124         Reviewed by Alex Christensen.
125
126         No new tests (At least one failing test now passes).
127
128         * bindings/js/JSIDBDatabaseCustom.cpp:
129         (WebCore::JSIDBDatabase::transaction): In addition to JSArrays, treat DOMStringLists as a valid string sequence.
130     
131 2015-12-09  Andreas Kling  <akling@apple.com>
132
133         [iOS] ResourceUsageOverlay should work on iOS.
134         <https://webkit.org/b/152021>
135
136         Reviewed by Antti Koivisto.
137
138         Make ResourceUsageOverlay work on iOS and on Mac desktops with UI-side compositing.
139
140         * page/ResourceUsageOverlay.cpp:
141         (WebCore::ResourceUsageOverlay::initialize): Move the overlay to the top of the view on iOS for now.
142         * page/ResourceUsageOverlay.h:
143         * page/cocoa/ResourceUsageOverlayCocoa.mm:
144         (WebCore::createColor): Make a custom CGColor factory since we can't use CGColorCreateGenericRGB on iOS.
145         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
146         (WebCore::ResourceUsageOverlay::platformInitialize): Put the overlay CALayer into a container layer and
147         hook it up with GraphicsLayer::setContentsToPlatformLayer so it works with all compositing modes.
148         (WebCore::showText): Move CGContextSaveGState call to the top of the function to preserve everything.
149         (WebCore::drawGraphLabel):
150         (WebCore::drawCpuHistory):
151         (WebCore::drawGCHistory):
152         (WebCore::ResourceUsageOverlay::platformDraw): Flip the CGContext if needed.
153         (WebCore::runSamplerThread): Update the layer rects on each thread iteration. This shouldn't be
154         necessary but it papers over an issue where the containing layer would shrink down to 0x0 and
155         disappear. Added a FIXME for this.
156         * platform/spi/cocoa/MachVMSPI.h: Add purgeable VM SPI.
157
158 2015-12-09  Brady Eidson  <beidson@apple.com>
159
160         Modern IDB: storage/indexeddb/database-closepending-flag.html fails.
161         https://bugs.webkit.org/show_bug.cgi?id=152095
162
163         Reviewed by Alex Christensen.
164
165         No new tests (At least one failing test now passes).
166         
167         The server-side checks the closepending flag before dispatching the event to the client, 
168         but due to the inherent asynchronous race between server and client, the client needs to 
169         check its closePending flag as well.
170
171         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
172         (WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent): Don't fire if m_closePending is set.
173
174 2015-12-09  David Hyatt  <hyatt@apple.com>
175
176         Picture element needs to respond to dynamic viewport changes.
177         https://bugs.webkit.org/show_bug.cgi?id=152013
178         <rdar://problem/23766375>
179
180         Reviewed by Dean Jackson.
181
182         Added new tests in fast/picture.
183
184         * css/MediaQueryEvaluator.cpp:
185         (WebCore::MediaQueryEvaluator::evalCheckingViewportDependentResults):
186         Add new evaluation method that adds viewport dependent results to a vector. A follow-up patch
187         will refactor the style resolver code to use this function instead of the special style resolver one, in order to
188         get rid of the code duplication. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152089.
189
190         * css/MediaQueryEvaluator.h:
191         (WebCore::MediaQueryResult::MediaQueryResult):
192         * css/StyleResolver.h:
193         (WebCore::MediaQueryResult::MediaQueryResult): Deleted.
194         Move MediaQueryResult into a header since it is used in multiple places now and not just by the style
195         resolver.
196
197         * dom/Document.cpp:
198         (WebCore::Document::evaluateMediaQueryList):
199         (WebCore::Document::checkViewportDependentPictures):
200         (WebCore::Document::optimizedStyleSheetUpdateTimerFired):
201         (WebCore::Document::applyContentDispositionAttachmentSandbox):
202         (WebCore::Document::addViewportDependentPicture):
203         (WebCore::Document::removeViewportDependentPicture):
204         * dom/Document.h:
205         The document now maintains a HashSet of viewport-dependent pictures, and it checks them whenever the
206         viewport changes. If their media queries stay the same, then nothing happens. If they change, then
207         the <picture> will go back and re-check all its <source> elements to see what the new best candidate is.
208
209         * html/HTMLImageElement.cpp:
210         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
211         Revised to check for viewport dependencies and to cache viewport-dependent results on the <picture> elements.
212         When a <picture> is found to be viewport-dependent (or not) it is also added to or removed from the document's
213         set of tracked pictures.
214
215         * html/HTMLPictureElement.cpp:
216         (WebCore::HTMLPictureElement::HTMLPictureElement):
217         (WebCore::HTMLPictureElement::~HTMLPictureElement):
218         (WebCore::HTMLPictureElement::didMoveToNewDocument):
219         (WebCore::HTMLPictureElement::create):
220         (WebCore::HTMLPictureElement::sourcesChanged):
221         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
222         * html/HTMLPictureElement.h:
223         New caching of results and updating of the document HashSet when the picture gets destroyed or moves to
224         a different document.
225
226         * html/HTMLSourceElement.cpp:
227         (WebCore::HTMLSourceElement::parseAttribute):
228         * html/HTMLSourceElement.h:
229         Cache the media attribute in a parsed form. A follow-up patch will improve the <video>/<audio>
230         code to make use of this parsed result. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152090.
231
232 2015-12-09  Zalan Bujtas  <zalan@apple.com>
233
234         TextPainter: Rename start and end position to selectionStart and selectionEnd.
235         https://bugs.webkit.org/show_bug.cgi?id=152088
236
237         Reviewed by Myles C. Maxfield.
238
239         They actually mean selection start/end.
240
241         No change in functionality.
242
243         * rendering/InlineTextBox.cpp:
244         (WebCore::InlineTextBox::paint):
245         * rendering/TextPainter.cpp:
246         (WebCore::TextPainter::TextPainter):
247         (WebCore::TextPainter::paintText):
248         * rendering/TextPainter.h:
249
250 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
251
252         AX: [GTK] Anonymous render block flow elements should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL
253         https://bugs.webkit.org/show_bug.cgi?id=152070
254
255         Reviewed by Mario Sanchez Prada.
256
257         Map the element to WebCore AccessibilityRole DivRole for GTK. This is being
258         done in the shared layer rather than in the platform layer because we want all
259         subsequent logic to treat anonymous render block flow elements as divs.
260
261         No new tests. We already have sufficient test coverage. The expectations
262         been updated accordingly.
263
264         * accessibility/AccessibilityRenderObject.cpp:
265         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
266
267 2015-12-09  Keith Rollin  <krollin@apple.com>
268
269         form.elements should reflect the element ordering after the HTML tree builder algorithm
270         https://bugs.webkit.org/show_bug.cgi?id=148870
271         rdar://problem/22589879
272
273         Reviewed by Ryosuke Niwa.
274
275         form.elements should return form-associated elements in tree order.
276         However, when presented with an HTML fragment like the following,
277         forms.elements is not built in tree order. Instead, the elements
278         appear in forms.element in the same order they appear in the HTML --
279         that is in the same order as they are parsed.
280
281         <form id=form>
282             <table>
283                 <tr>
284                     <td><input type="radio" name="radio1" id="r1" value=1></td>
285                     <td><input type="radio" name="radio2" id="r2" value=2></td>
286                     <input type="radio" name="radio0" id="r0" value=0>
287                 </tr>
288             </table>
289         </form>
290
291         The reason why elements appear in forms.elements in parse order is
292         because they register themselves with the designated form when they
293         are created. At this time, they are not in the DOM tree, so the form
294         can only assume that the element will be appended to the DOM tree,
295         with the result that it records the elements in the HTML fragment
296         above as [r1, r2, r0].
297
298         However, it's not always the case that the newly-created element will
299         be appended to the current tree. In the HTML fragment above, the r0
300         input element is hoised out of the table element. It ends up being the
301         preceding sibling of the table element, with the result that the
302         actual tree-order of the input elements is [r0, r1, r2].
303
304         Because the problem is due to registering form-associated elements
305         with the form *before* the elements are added to the DOM tree, the
306         solution is to defer that registration until afterwards. With the new
307         element in the tree, the form can now use its current location in the
308         tree to correctly place the element in form.elements.
309
310         Existing tests now pass:
311         - imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-elements-nameditem-02-html
312
313         * html/FormAssociatedElement.cpp:
314         (WebCore::FormAssociatedElement::FormAssociatedElement):
315         (WebCore::FormAssociatedElement::insertedInto):
316         (WebCore::FormAssociatedElement::removedFrom):
317         (WebCore::FormAssociatedElement::formRemovedFromTree):
318         (WebCore::FormAssociatedElement::formWillBeDestroyed):
319         * html/FormAssociatedElement.h:
320         * html/HTMLFormControlElement.cpp:
321         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
322         * html/HTMLImageElement.cpp:
323         (WebCore::HTMLImageElement::HTMLImageElement):
324         (WebCore::HTMLImageElement::insertedInto):
325         (WebCore::HTMLImageElement::removedFrom):
326         * html/HTMLImageElement.h:
327         * html/HTMLObjectElement.cpp:
328         (WebCore::HTMLObjectElement::HTMLObjectElement):
329
330 2015-12-09  Gwang Yoon Hwang  <yoon@igalia.com>
331
332         [ThreadedCompositor] Support HTML5 Video
333         https://bugs.webkit.org/show_bug.cgi?id=143301
334
335         Reviewed by Žan Doberšek.
336
337         This patch implements HTML5 Video supports in Threaded Compositor.
338
339         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
340         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
341         Added to support GStreamer GL by ensuring unmapping of the swapped
342         GstVideoFrame performed at GStreamer GL's gl thread.
343         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
344         Modified to upload decoded frame to the given texture instead of
345         creating a texture itself because we should use a texture from the
346         proxy when we are using the threaded compositor.
347         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
348         Implements two ways to send a texture from GStreamer to the compositor.
349         1. If we are not using GStreamer GL, we are going to acquire a free texture
350         from a TextureMapperPlatformLayerProxy and upload the decoded frame to the
351         texture. This should be done at the compositing thread because we
352         don't have a Gst's GL thread.
353         2. If we are using GStreamer GL, we map a texture for the given frame
354         and passes it to the compositing thread. The mapped frame will be
355         freed if it is swapped out or the layer is removed.
356
357         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
358         Modified to aquire a new texture itself.
359
360         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
361         Adds a way to pass a function to the compositing thread to allocate /
362         upload textures at the compositing thread.
363
364
365 2015-12-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
366
367         [Streams API] pipeThrough test failing
368         https://bugs.webkit.org/show_bug.cgi?id=152061
369
370         Reviewed by Youenn Fablet.
371
372         Test: imported/w3c/web-platform-tests/streams-api/readable-streams/pipe-through.html
373
374         * Modules/streams/ReadableStream.js:
375         (pipeThrough): Mimic destructuring for the streams parameter.
376
377 2015-12-09  Frederic Wang  <fred.wang@free.fr>
378
379         Bad position of large operators inside an munderover element
380         https://bugs.webkit.org/show_bug.cgi?id=151916
381
382         Reviewed by Alejandro G. Castro.
383
384         Test: mathml/opentype/large-operators-munderover.html
385
386         * rendering/mathml/RenderMathMLOperator.h:
387         (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator.
388         * rendering/mathml/RenderMathMLUnderOver.cpp:
389         (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators.
390
391 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
392
393         [TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data access
394         https://bugs.webkit.org/show_bug.cgi?id=152053
395
396         Reviewed by Martin Robinson.
397
398         TextureMapperTiledBackingStore should call ImageObserver::didDraw() on the Image's
399         observer after updating the tile with the Image's data. This way the CachedImage
400         (i.e. the observer) can mark the data access with the current timestamp, avoiding
401         removing the decoded data in the very near future during a cache purge.
402
403         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
404         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
405
406 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
407
408         Make MainThreadSharedTimerGtk implementation GLib-specific
409         https://bugs.webkit.org/show_bug.cgi?id=152044
410
411         Reviewed by Carlos Garcia Campos.
412
413         MainThreadSharedTimerGtk has implementation that only directly depends
414         on GLib, and not GTK+. Because of that it can be moved under
415         Source/WebCore/platform/glib and slightly renamed.
416
417         * PlatformGTK.cmake:
418         * platform/glib/MainThreadSharedTimerGLib.cpp: Renamed from Source/WebCore/platform/gtk/MainThreadSharedTimerGtk.cpp.
419         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
420         (WebCore::MainThreadSharedTimer::setFireInterval):
421         (WebCore::MainThreadSharedTimer::stop):
422         (WebCore::MainThreadSharedTimer::invalidate):
423         * platform/gtk/MainThreadSharedTimerGtk.cpp:
424         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): Deleted.
425         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
426         (WebCore::MainThreadSharedTimer::stop): Deleted.
427         (WebCore::MainThreadSharedTimer::invalidate): Deleted.
428
429 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
430
431         [TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4
432         https://bugs.webkit.org/show_bug.cgi?id=152042
433
434         Reviewed by Martin Robinson.
435
436         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
437         (WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out
438         the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4
439         and fill that via the TransformationMatrix::toColumnMajorFloatArray() method
440         called on the passed-in TransformationMatrix.
441
442 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
443
444         [Soup] Attach the SocketStreamHandleSoup write-ready source to the thread-default context
445         https://bugs.webkit.org/show_bug.cgi?id=152041
446
447         Reviewed by Carlos Garcia Campos.
448
449         * platform/network/soup/SocketStreamHandleSoup.cpp:
450         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Attach the
451         write-ready source to the thread-default context, instead of implicitly
452         relying on the default context for dispatching.
453
454 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
455
456         [Soup] SocketStreamHandle should call g_source_destroy() on the write-ready source
457         https://bugs.webkit.org/show_bug.cgi?id=152040
458
459         Reviewed by Carlos Garcia Campos.
460
461         * platform/network/soup/SocketStreamHandleSoup.cpp:
462         (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Instead of
463         calling the g_source_get_id()-g_source_remove() pair, destroy the source via
464         the g_source_destroy() call. Also use nullptr to clear out the pointer
465         variable.
466
467 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
468
469         Make AudioBusGtk implementation GLib-specific
470         https://bugs.webkit.org/show_bug.cgi?id=152049
471
472         Reviewed by Philippe Normand.
473
474         AudioBusGtk only depends on GLib, so it should be moved to
475         Source/WebCore/platform/audio/glib and the implementation file
476         renamed to AudioBusGLib.cpp.
477
478         The hard-coded webkitgtk path component can be addressed later.
479
480         * PlatformGTK.cmake: Update the build target.
481         * platform/audio/glib/AudioBusGLib.cpp: Renamed from Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp.
482         (WebCore::AudioBus::loadPlatformResource):
483         * platform/audio/gtk/AudioBusGtk.cpp:
484         (WebCore::AudioBus::loadPlatformResource): Deleted.
485
486 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
487
488         AX: [EFL] Consider deferring to WebCore Accessibility for table exposure
489         https://bugs.webkit.org/show_bug.cgi?id=144898
490
491         Reviewed by Darin Adler.
492
493         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
494         for WebKitEfl.
495
496         No new tests. Several existing tests already cover table exposure. They have
497         been updated accordingly.
498
499         * accessibility/AccessibilityTable.cpp:
500         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
501
502 2015-12-08  Simon Fraser  <simon.fraser@apple.com>
503
504         Convert resetAnimValToBaseVal take a reference to a SVGAnimatedType
505         https://bugs.webkit.org/show_bug.cgi?id=152036
506
507         Reviewed by Zalan Bujtas.
508         
509         Change resetAnimValToBaseVal() to take a reference at the last argument.
510
511         * svg/SVGAnimateElementBase.cpp:
512         (WebCore::SVGAnimateElementBase::resetAnimatedType):
513         * svg/SVGAnimatedAngle.cpp:
514         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
515         * svg/SVGAnimatedAngle.h:
516         * svg/SVGAnimatedBoolean.cpp:
517         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
518         * svg/SVGAnimatedBoolean.h:
519         * svg/SVGAnimatedColor.h:
520         * svg/SVGAnimatedEnumeration.cpp:
521         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
522         * svg/SVGAnimatedEnumeration.h:
523         * svg/SVGAnimatedInteger.cpp:
524         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
525         * svg/SVGAnimatedInteger.h:
526         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
527         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
528         * svg/SVGAnimatedIntegerOptionalInteger.h:
529         * svg/SVGAnimatedLength.cpp:
530         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
531         * svg/SVGAnimatedLength.h:
532         * svg/SVGAnimatedLengthList.cpp:
533         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
534         * svg/SVGAnimatedLengthList.h:
535         * svg/SVGAnimatedNumber.cpp:
536         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
537         * svg/SVGAnimatedNumber.h:
538         * svg/SVGAnimatedNumberList.cpp:
539         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
540         * svg/SVGAnimatedNumberList.h:
541         * svg/SVGAnimatedNumberOptionalNumber.cpp:
542         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal):
543         * svg/SVGAnimatedNumberOptionalNumber.h:
544         * svg/SVGAnimatedPath.cpp:
545         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
546         * svg/SVGAnimatedPath.h:
547         * svg/SVGAnimatedPointList.cpp:
548         (WebCore::SVGAnimatedPointListAnimator::resetAnimValToBaseVal):
549         * svg/SVGAnimatedPointList.h:
550         * svg/SVGAnimatedPreserveAspectRatio.cpp:
551         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal):
552         * svg/SVGAnimatedPreserveAspectRatio.h:
553         * svg/SVGAnimatedRect.cpp:
554         (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
555         * svg/SVGAnimatedRect.h:
556         * svg/SVGAnimatedString.cpp:
557         (WebCore::SVGAnimatedStringAnimator::resetAnimValToBaseVal):
558         * svg/SVGAnimatedString.h:
559         * svg/SVGAnimatedTransformList.cpp:
560         (WebCore::SVGAnimatedTransformListAnimator::resetAnimValToBaseVal):
561         * svg/SVGAnimatedTransformList.h:
562         * svg/SVGAnimatedTypeAnimator.h:
563         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValue):
564         (WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
565
566 2015-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
567
568         Remove Mavericks-specific code from FontCacheMac
569         https://bugs.webkit.org/show_bug.cgi?id=152030
570
571         Reviewed by Simon Fraser.
572
573         Mavericks is no longer a supported platform.
574
575         No new tests because there is no behavior change.
576
577         * platform/graphics/mac/FontCacheMac.mm:
578         (WebCore::platformLookupFallbackFont):
579         (WebCore::platformFontWithFamilySpecialCase): Deleted.
580
581 2015-12-08  Brady Eidson  <beidson@apple.com>
582
583         Modern IDB: storage/indexeddb/objectstore-cursor.html fails.
584         https://bugs.webkit.org/show_bug.cgi?id=152023
585
586         Reviewed by Alex Christensen.
587
588         No new tests (At least one failing test now passes).
589
590         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
591         (WebCore::IDBServer::MemoryObjectStoreCursor::MemoryObjectStoreCursor):
592         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange): Make sure the
593           found iterator is actually in the target range.
594
595 2015-12-08  Jer Noble  <jer.noble@apple.com>
596
597         Changing <video> src during 'ended' event can leave screen sleep disabled
598         https://bugs.webkit.org/show_bug.cgi?id=152018
599
600         Reviewed by Eric Carlson.
601
602         Resetting a HTMLMediaElement's src during 'ended' introduces a race condition: whether
603         the 'mediaPlayerRateChanged()' notification will fire before createMediaPlayer() destroys
604         the old MediaPlayer firing said notification.
605
606         To break the race condition, always update the sleep disabling assertion after destroying
607         the media player (by creating a new one).
608
609         * html/HTMLMediaElement.cpp:
610         (WebCore::HTMLMediaElement::createMediaPlayer):
611
612 2015-12-08  Brady Eidson  <beidson@apple.com>
613
614         Modern IDB: Fire blocked events for delete requests that are blocked.
615         https://bugs.webkit.org/show_bug.cgi?id=152015
616
617         Reviewed by Alex Christensen.
618
619         No new tests (Previous failing tests now pass, and previously timing-out tests now complete).
620
621         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
622         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase):
623         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
624         (WebCore::IDBServer::UniqueIDBDatabase::deleteOrRunTransactionsTimerFired):
625         * Modules/indexeddb/server/UniqueIDBDatabase.h:
626
627 2015-12-08  Brady Eidson  <beidson@apple.com>
628
629         Modern IDB: Fire blocked events for upgrade requests that are blocked.
630         https://bugs.webkit.org/show_bug.cgi?id=152007
631
632         Reviewed by Alex Christensen.
633
634         Test: storage/indexeddb/modern/blocked-open-db-requests.html
635               And some that used to fail now pass.
636               And some that used to timeout now complete.
637
638         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
639         (WebCore::IDBClient::IDBConnectionToServer::notifyOpenDBRequestBlocked):
640         * Modules/indexeddb/client/IDBConnectionToServer.h:
641
642         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
643         (WebCore::IDBClient::IDBDatabase::IDBDatabase):
644
645         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
646         (WebCore::IDBClient::IDBOpenDBRequest::requestBlocked):
647         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
648
649         * Modules/indexeddb/client/IDBRequestImpl.cpp:
650         (WebCore::IDBClient::IDBRequest::dispatchEvent):
651
652         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
653         (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
654         * Modules/indexeddb/server/IDBConnectionToClient.h:
655         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
656
657         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
658         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): When a request that would
659           result in a version change transaction is blocked by open connections, notify it.
660
661         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
662         (WebCore::InProcessIDBServer::notifyOpenDBRequestBlocked):
663         * Modules/indexeddb/shared/InProcessIDBServer.h:
664
665 2015-12-08  Per Arne Vollan  <peavo@outlook.com>
666
667         [WinCairo] Compile error.
668         https://bugs.webkit.org/show_bug.cgi?id=152008
669
670         Reviewed by Brent Fulgham.
671
672         GLuint is undefined.
673
674         * platform/graphics/GraphicsContext3D.h:
675
676 2015-12-08  Zalan Bujtas  <zalan@apple.com>
677
678         Light cleanup in TextPainter.
679         https://bugs.webkit.org/show_bug.cgi?id=151994
680
681         Reviewed by Darin Adler.
682
683         No change in functionality.
684
685         * rendering/TextPainter.cpp:
686         (WebCore::TextPainter::TextPainter):
687         * rendering/TextPainter.h: Address post review comment.
688         (WebCore::ShadowApplier::isLastShadowIteration):
689         (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText):
690
691 2015-12-08  Zalan Bujtas  <zalan@apple.com>
692
693         Do not insert positioned renderers to multiple gPositionedDescendantsMap.
694         https://bugs.webkit.org/show_bug.cgi?id=151878
695         rdar://problem/22229889
696
697         Reviewed by Simon Fraser.
698
699         We insert positioned renderers into a static map (RenderBlock::gPositionedDescendantsMap) to keep track of them.
700         This static map is at block level. A particular absolute positioned object is added to its closest ancestor that
701         returns true for RenderElement::canContainAbsolutelyPositionedObjects().
702         canContainAbsolutelyPositionedObjects() returns true if the ancestor is either positioned or has transform.
703         If this container's style changes so that it's no longer positioned and it has no transform anymore,
704         we need to clear its static map of positioned objects (they'll get re-inserted to another ancestor at next layout).
705
706         This patch addresses the case when the renderer does not have transforms anymore.
707
708         Test: fast/block/positioning/crash-when-transform-is-removed.html
709
710         * rendering/RenderBlock.cpp:
711         (WebCore::RenderBlock::styleWillChange):
712
713 2015-12-08  Eric Carlson  <eric.carlson@apple.com>
714
715         [MediaStream] Rename UserMediaClient and UserMediaController methods
716         https://bugs.webkit.org/show_bug.cgi?id=152001
717
718         Reviewed by Brady Eidson.
719
720         No new tests, no behavior change.
721
722         * Modules/mediastream/UserMediaClient.h:
723         (WebCore::UserMediaClient::~UserMediaClient):
724         * Modules/mediastream/UserMediaController.h:
725         (WebCore::UserMediaController::client):
726         (WebCore::UserMediaController::from):
727         (WebCore::UserMediaController::requestUserMediaAccess):
728         (WebCore::UserMediaController::cancelUserMediaAccessRequest):
729         (WebCore::UserMediaController::requestPermission): Deleted.
730         (WebCore::UserMediaController::cancelRequest): Deleted.
731         * Modules/mediastream/UserMediaRequest.cpp:
732         (WebCore::UserMediaRequest::constraintsValidated):
733         (WebCore::UserMediaRequest::contextDestroyed):
734         * platform/mock/UserMediaClientMock.h:
735
736 2015-12-08  Jer Noble  <jer.noble@apple.com>
737
738         [iOS] Do not exit fullscreen mode during auto-PiP.
739         https://bugs.webkit.org/show_bug.cgi?id=151889
740
741         Reviewed by Darin Adler.
742
743         When auto-PiPing, do not exit fullscreen mode, as that causes a two-step animation upon returing from auto-PiP.
744
745         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
746         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Handle the case where we open Safari after an
747             auto-PiP by clicking on a link; if so, hide the fullscreen window.
748         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Do not exit fullscreen during auto-PiP.
749         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Ditto.
750
751 2015-12-08  Per Arne Vollan  <peavo@outlook.com>
752
753         [WinCairo] Remove unneeded function.
754         https://bugs.webkit.org/show_bug.cgi?id=151989
755
756         Reviewed by Brent Fulgham.
757
758         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
759         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::createOptimalVideoType):
760         (MFCreateMediaType): Deleted.
761
762 2015-12-08  Jer Noble  <jer.noble@apple.com>
763
764         [iOS] Adopt WebFullScreenVideoRootViewController.
765         https://bugs.webkit.org/show_bug.cgi?id=151996
766
767         Reviewed by Dan Bernstein.
768
769         Adopt WebFullScreenVideoRootViewController from WebKitAdditions. If it is not available, create and use
770         a generic UIViewController subclass.
771
772         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
773         (createFullScreenVideoRootViewControllerClass):
774         (allocWebFullScreenVideoRootViewControllerInstance):
775         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
776
777 2015-12-08  Andy Estes  <aestes@apple.com>
778
779         ImmutableNFANodeBuilder's move constructor moves an uninitialized member variable into itself
780         https://bugs.webkit.org/show_bug.cgi?id=151982
781
782         Reviewed by Darin Adler.
783
784         * contentextensions/ImmutableNFANodeBuilder.h:
785         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder):
786
787 2015-12-08  Andreas Kling  <akling@apple.com>
788
789         [Cocoa] ResourceUsageOverlay should query kernel for VM page size.
790         <https://webkit.org/b/151920>
791
792         Reviewed by Andy Estes.
793
794         Read the vm.pagesize sysctl to find the correct page size for memory usage calculations.
795         This fixes broken math on systems that have different hw.pagesize and vm.pagesize.
796
797         * page/cocoa/ResourceUsageOverlayCocoa.mm:
798         (WebCore::vmPageSize):
799         (WebCore::pagesPerVMTag):
800         (WebCore::runSamplerThread):
801
802 2015-12-08  Chris Dumez  <cdumez@apple.com>
803
804         Add diagnostic logging to measure speculative revalidation accuracy
805         https://bugs.webkit.org/show_bug.cgi?id=151953
806         <rdar://problem/23092196>
807
808         Reviewed by Darin Adler.
809
810         Add diagnostic logging to measure speculative revalidation accuracy.
811
812         * page/DiagnosticLoggingKeys.cpp:
813         (WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey):
814         (WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey):
815         (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey):
816         (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey):
817         (WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey):
818         (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey):
819         (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey):
820         * page/DiagnosticLoggingKeys.h:
821
822 2015-12-08  Brady Eidson  <beidson@apple.com>
823
824         Modern IDB: storage/indexeddb/index-cursor.html fails.
825         https://bugs.webkit.org/show_bug.cgi?id=151973
826
827         Reviewed by Darin Adler.
828
829         No new tests (At least one failing test now passes).
830
831         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
832         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor): When the initial cursor creation
833           generates an iterator outside of the cursor's IDBKeyRange, invalidate the iterator.
834           
835 2015-12-08  Joanmarie Diggs  <jdiggs@igalia.com>
836
837         [EFL] some ax tests have been failed since r186692
838         https://bugs.webkit.org/show_bug.cgi?id=146887
839
840         Reviewed by Mario Sanchez Prada.
841
842         The tests were failing because there are now two WebCore accessibility
843         roles which need to implement the AtkTable interface: TableRole and
844         GridRole. Because the latter was not added in r186692, any tests with
845         ARIA role grid that accessed cells via coordinates stopped working.
846
847         No new tests; instead unskipped all the broken table tests which now pass.
848
849         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
850         (getInterfaceMaskFromObject):
851
852 2015-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
853
854         [ThreadedCompositor] Add support for Cairo GL-backed ImageBuffer.
855         https://bugs.webkit.org/show_bug.cgi?id=151986
856
857         Reviewed by Žan Doberšek.
858
859         This patch adds a support for accelerated 2d canvas which uses cairo-gl as its
860         backend to the threaded compositor. Basically, it applies same way to support
861         WebGL for the threaded compositor.
862
863         Unfortunately, we cannot swap the buffer for the accelerated 2d canvas because
864         it should preserve the buffer of the previous frame when drawing new contents.
865         Because of that, the surface of the accelerated 2d canvas will be copied for
866         each frame.
867
868         * platform/graphics/cairo/ImageBufferCairo.cpp:
869         (WebCore::ImageBufferData::ImageBufferData):
870         (WebCore::ImageBufferData::createCompositorBuffer): Prepare a texture
871         surface to push the rendered result to the compositing thread.
872         (WebCore::ImageBufferData::swapBuffersIfNeeded): Copies the contents
873         of the canvas's surface to the compositing texture.
874         (WebCore::ImageBufferData::createCairoGLSurface): Moved to the inside
875         of ImageBufferData.
876
877 2015-12-08  Joanmarie Diggs  <jdiggs@igalia.com>
878
879         [GTK] 15 accessibility tests fail since r186692.
880         https://bugs.webkit.org/show_bug.cgi?id=148938
881
882         Reviewed by Mario Sanchez Prada.
883
884         Failing tests rebaselined.
885
886         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
887         (atkRole): Treat GridCellRole and CellRole the same.
888         (roleIsTextType): Treat GridCellRole and CellRole the same.
889
890 2015-12-08  Frederic Wang  <fred.wang@free.fr>
891
892         [cairo] Solid stroke of lines with thickness less than 1 pixel broken after r191658
893         https://bugs.webkit.org/show_bug.cgi?id=151947
894
895         Reviewed by Martin Robinson.
896
897         Test: mathml/presentation/radical-bar-visibility.html
898
899         * platform/graphics/cairo/GraphicsContextCairo.cpp:
900         (WebCore::GraphicsContext::drawLine): Force a minimal thickness of 1px
901
902 2015-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
903
904         [ThreadedCompositor] Support WebGL for OpenGL.
905         https://bugs.webkit.org/show_bug.cgi?id=143300
906
907         Reviewed by Žan Doberšek.
908
909         To remove pixel transfer operation, this patch adds m_compositorFBO which uses same depth and stencil
910         buffer with m_fbo but uses m_compositorTexture as a color attachment in GraphicsContext3D.
911         Because switching target framebuffer is cheaper than pixel transfer operation and switching color
912         attachment of m_fbo. In Threaded Compositor, when WebGL renders a scene, prepareTexture swaps
913         m_fbo with m_compositorFBO and send the color attachment to the compositor thread.
914         This patch only supports WebGL for OpenGL. OpenGLES will be covered in following-up patches.
915
916         No new tests needed.
917
918         * platform/graphics/GraphicsContext3D.h:
919         * platform/graphics/GraphicsContext3DPrivate.cpp:
920         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
921         (WebCore::GraphicsContext3DPrivate::proxy):
922         (WebCore::GraphicsContext3DPrivate::swapBuffersIfNeeded):
923         Implement interfaces to pass a rendered texture to the compositing
924         thread.
925         * platform/graphics/GraphicsContext3DPrivate.h:
926         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
927         (WebCore::GraphicsContext3D::GraphicsContext3D):
928         (WebCore::GraphicsContext3D::~GraphicsContext3D):
929         Create additional compositing texture and FBO to swaping buffers for
930         threaded compositor.
931         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
932         (WebCore::GraphicsContext3D::reshapeFBOs):
933         (WebCore::GraphicsContext3D::attachDepthAndStencilBufferIfNeeded):
934         Split attaching depth and stencil buffer codes from reshapeFBOs
935         to make complete framebuffer with not only m_fbo but m_compositorFBO also.
936         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
937         (WebCore::GraphicsContext3D::prepareTexture):
938         If we are in the threaded compositor, we will swap m_fbo with
939         m_compositorFBO instead of copying it.
940
941 2015-12-07  Zalan Bujtas  <zalan@apple.com>
942
943         Make paintTextWithShadows a member function (TextPainter).
944         https://bugs.webkit.org/show_bug.cgi?id=151979
945
946         Reviewed by Simon Fraser.
947
948         This patch also simplifies paintTextWithShadows and
949         rearranges some of the functions' arguments. 
950
951         No change in functionality.
952
953         * rendering/TextPainter.cpp:
954         (WebCore::TextPainter::drawTextOrEmphasisMarks):
955         (WebCore::TextPainter::paintTextWithShadows):
956         (WebCore::TextPainter::paintEmphasisMarksIfNeeded):
957         (WebCore::TextPainter::paintTextWithStyle):
958         (WebCore::TextPainter::paintText):
959         (WebCore::drawTextOrEmphasisMarks): Deleted.
960         (WebCore::paintTextWithShadows): Deleted.
961         * rendering/TextPainter.h:
962
963 2015-12-07  Brady Eidson  <beidson@apple.com>
964
965         Modern IDB: storage/indexeddb/factory-deletedatabase.html fails.
966         https://bugs.webkit.org/show_bug.cgi?id=151966
967
968         Reviewed by Sam Weinig.
969
970         No new tests (At least one failing test now passes).
971
972         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
973         (WebCore::IDBClient::IDBOpenDBRequest::onDeleteDatabaseSuccess): The spec says that the result of
974           deleteDatabase should be undefined. Without explicitly making it undefined, it's incorrectly null.
975
976 2015-12-07  Brady Eidson  <beidson@apple.com>
977
978         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
979         https://bugs.webkit.org/show_bug.cgi?id=151961
980
981         Reviewed by Alex Christensen.
982
983         No new tests (At least one failing test now passes).
984
985         When an index cursor's iterator was invalidated, there were some cases where it did 
986         not correctly find the next iterator to pick up where it left off.
987
988         * Modules/indexeddb/client/IDBCursorImpl.cpp:
989         (WebCore::IDBClient::IDBCursor::update):
990         (WebCore::IDBClient::IDBCursor::deleteFunction):
991         
992         * Modules/indexeddb/server/IndexValueStore.cpp:
993         (WebCore::IDBServer::IndexValueStore::find):
994         (WebCore::IDBServer::IndexValueStore::loggingString):
995         * Modules/indexeddb/server/IndexValueStore.h:
996
997 2015-12-07  Zalan Bujtas  <zalan@apple.com>
998
999         Refactor TextPainter::paintText() into sub methods.
1000         https://bugs.webkit.org/show_bug.cgi?id=151962
1001
1002         Reviewed by Myles C. Maxfield.
1003
1004         No change in functionality.
1005
1006         * rendering/TextPainter.cpp:
1007         (WebCore::TextPainter::paintTextWithEmphasisIfNeeded):
1008         (WebCore::TextPainter::paintTextWithStyle):
1009         (WebCore::TextPainter::paintText):
1010         * rendering/TextPainter.h:
1011
1012 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1013
1014         [GTK] Clean up virtual functions in MediaPlayerPrivateGStreamerBase
1015         https://bugs.webkit.org/show_bug.cgi?id=151940
1016
1017         Reviewed by Carlos Garcia Campos.
1018
1019         - Using 'override' when appropriate
1020         - Explicitly marking methods as virtual when they are inherently virtual
1021
1022         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1023
1024 2015-12-07  Saam barati  <sbarati@apple.com>
1025
1026         Add op_watchdog opcode that is generated when VM has a watchdog
1027         https://bugs.webkit.org/show_bug.cgi?id=151954
1028
1029         Reviewed by Mark Lam.
1030
1031         No new tests because JSC already has tests for this.
1032
1033         * bindings/js/WorkerScriptController.cpp:
1034         (WebCore::WorkerScriptController::scheduleExecutionTermination):
1035         (WebCore::WorkerScriptController::isTerminatingExecution):
1036
1037 2015-12-07  Brian Burg  <bburg@apple.com>
1038
1039         Web Inspector: Uncaught Exception page should have better styles and handle more error cases
1040         https://bugs.webkit.org/show_bug.cgi?id=151923
1041
1042         Reviewed by Timothy Hatcher.
1043
1044         Add a check for InspectorFrontendAPI before calling it. This can fail
1045         easily if an uncaught exception stalls initial loading, or whenever
1046         the Inspector frontend is reloaded.
1047
1048         * inspector/InspectorFrontendClientLocal.cpp:
1049         (WebCore::InspectorFrontendClientLocal::evaluateOnLoad):
1050
1051 2015-12-07  Beth Dakin  <bdakin@apple.com>
1052
1053         Hook up request and show for typing candidates in WK1
1054         https://bugs.webkit.org/show_bug.cgi?id=151831
1055         -and corresponding-
1056         <rdar://problem/23751214>
1057
1058         Reviewed by Enrica Casucci.
1059
1060         New SPI that is needed.
1061         * WebCore.xcodeproj/project.pbxproj:
1062         * platform/spi/mac/NSSpellCheckerSPI.h: Added.
1063
1064         Request candidates for editable content whenever selection changes.
1065         * editing/Editor.cpp:
1066         (WebCore::Editor::respondToChangedSelection):
1067
1068         Implement requestCandidatesForSelection on the EditorClient.
1069         * loader/EmptyClients.h:
1070         * page/EditorClient.h:
1071         (WebCore::EditorClient::requestCandidatesForSelection):
1072
1073 2015-12-07  Brady Eidson  <beidson@apple.com>
1074
1075         Modern IDB: Fix "old versions" when upgrading databases.
1076         https://bugs.webkit.org/show_bug.cgi?id=151948
1077
1078         Reviewed by Alex Christensen.
1079
1080         No new tests (5 failing tests now pass, and updated results for a 6th test).
1081
1082         This includes the old version on the IDBVersionChangeEvent, as well as the version the 
1083         IDBDatabase is left with if the version change transaction is aborted.
1084
1085         Primary mechanism of the fix is to include the original IDBDatabaseInfo along with 
1086         IDBTransactionInfos that represent version change transactions.
1087
1088         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1089         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
1090         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
1091
1092         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1093         (WebCore::IDBClient::IDBOpenDBRequest::onUpgradeNeeded):
1094
1095         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1096         (WebCore::IDBClient::IDBTransaction::IDBTransaction): Deleted.
1097         (WebCore::IDBClient::IDBTransaction::finishAbortOrCommit): Deleted.
1098         * Modules/indexeddb/client/IDBTransactionImpl.h:
1099         (WebCore::IDBClient::IDBTransaction::info):
1100         (WebCore::IDBClient::IDBTransaction::originalDatabaseInfo):
1101
1102         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1103         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1104         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1105         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1106         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
1107
1108         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
1109         (WebCore::IDBTransactionInfo::versionChange):
1110         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
1111         (WebCore::IDBTransactionInfo::isolatedCopy):
1112         * Modules/indexeddb/shared/IDBTransactionInfo.h:
1113         (WebCore::IDBTransactionInfo::originalDatabaseInfo):
1114
1115 2015-12-07  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1116
1117         Update Objective-C code generator to pass a reference to calling object for partial interfaces
1118         https://bugs.webkit.org/show_bug.cgi?id=151739
1119
1120         Reviewed by Darin Adler.
1121
1122         The fix updates the Objective-C code generator to pass a reference to calling object for partial interfaces.
1123         The change from pass by pointer to pass by reference was introduced in r192849.
1124
1125         * bindings/scripts/CodeGeneratorObjC.pm:
1126         (GenerateImplementation):
1127         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
1128         (-[DOMTestInterface supplementalStr1]):
1129         (-[DOMTestInterface supplementalStr2]):
1130         (-[DOMTestInterface setSupplementalStr2:]):
1131         (-[DOMTestInterface supplementalStr3]):
1132         (-[DOMTestInterface setSupplementalStr3:]):
1133         (-[DOMTestInterface supplementalNode]):
1134         (-[DOMTestInterface setSupplementalNode:]):
1135         (-[DOMTestInterface builtinAttribute]):
1136         (-[DOMTestInterface setBuiltinAttribute:]):
1137         (-[DOMTestInterface supplementalMethod1]):
1138         (-[DOMTestInterface supplementalMethod2:objArg:]):
1139         (-[DOMTestInterface supplementalMethod3]):
1140         (-[DOMTestInterface supplementalMethod4]):
1141         (-[DOMTestInterface builtinFunction]):
1142
1143 2015-12-07  Chris Dumez  <cdumez@apple.com>
1144
1145         Crash in MemoryCache::pruneDeadResourcesToSize()
1146         https://bugs.webkit.org/show_bug.cgi?id=151833
1147         <rdar://problem/22392235>
1148
1149         Reviewed by David Kilzer.
1150
1151         MemoryCache::pruneDeadResourcesToSize() is iterating over m_allResources
1152         (which is a vector of LRUList). It first destroys decoded data for each
1153         resource in the LRUList. Then, if it does not suffice to reach the
1154         target size, and starts actually removing resources from the cache.
1155
1156         The issue is that this code alters m_allResources (and its LRULists) as
1157         it is iterating over it. We tried to deal with this in various ways:
1158         1. Increment the iterator before removing the resource pointed by the
1159           iterator.
1160         2. Protect the next resource in the LRUList and abort early if it is no
1161           longer in the cache.
1162
1163         This adds code complexity and apparently does not correctly handle all
1164         the edge cases as we still see crashes in this code. In particular, I
1165         suspect that 2. may not be sufficient if it is possible for the next
1166         resource to be moved to another LRUList (in which case, next->inCache()
1167         would still return true but the iterator would however become invalid).
1168
1169         To make the code simpler and more robust, this patch copies the LRUList
1170         (and refs the CachedResources) before iterating over it. This is a lot
1171         safer and should hopefully fix the crashes we see in this function.
1172
1173         No new tests, no reproduction case.
1174
1175         * loader/cache/MemoryCache.cpp:
1176         (WebCore::MemoryCache::pruneDeadResourcesToSize):
1177
1178 2015-12-07  Brady Eidson  <beidson@apple.com>
1179
1180         Modern IDB: Add some more custom exception messages, passing some more tests..
1181         https://bugs.webkit.org/show_bug.cgi?id=151912
1182
1183         Reviewed by Andy Estes.
1184
1185         No new tests (Covered by existing tests).
1186
1187         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1188         (WebCore::IDBClient::IDBObjectStore::index):
1189         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1190         (WebCore::IDBClient::IDBTransaction::objectStore):
1191
1192 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1193
1194         [ThreadedCompositor] Add support for PlatformLayer.
1195         https://bugs.webkit.org/show_bug.cgi?id=143299
1196
1197         Reviewed by Žan Doberšek.
1198
1199         This patch implements TextureMapperPlatformLayerProxy and TextureMapperPlatformLayerBuffer to
1200         send a texture (actual texture or BitmapTexture) to the compositing thread directly.
1201         Platform layer renderers should implement TextureMapperPlatformLayerProxyProvider to establish
1202         a connection to the compositing thread. After the connection has been established, the renderer
1203         can render its contents to the TextureMapperPlatformLayerBuffer and pass it to the compositing thread
1204         via TextureMapperPlatformLayer proxy.
1205         The buffer can be an unmanaged texture (a.k.a. platform texture) or BitmapTexture.
1206         For the unmanaged texture, the renderer should manage its life cycle itself. For the BitmapTexture,
1207         it will be managed by TextureMapperPlatformLayerProxy. In that case, used (swapped) buffer will be
1208         recycled because the renderer will use same size and format until it changes its size.
1209
1210         No new tests needed.
1211
1212         * PlatformGTK.cmake:
1213         Adds TextureMapperPlatformLayerBuffer and TextureMapperPlaytformLayerProxy.
1214
1215         * platform/graphics/GraphicsContext3DPrivate.cpp:
1216         * platform/graphics/GraphicsContext3DPrivate.h:
1217         * platform/graphics/cairo/ImageBufferCairo.cpp:
1218         * platform/graphics/cairo/ImageBufferDataCairo.h:
1219         Adds mock implementation.
1220
1221         * platform/graphics/PlatformLayer.h:
1222         Adds TextureMapperPlatformLayerProxyProvider as a PlatformLayer for the Threaded Compositor
1223
1224         * platform/graphics/texmap/BitmapTextureGL.h:
1225         (WebCore::BitmapTextureGL::internalFormat): Adds a getter to check the
1226         internal format of texture to check reusability.
1227
1228         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1229         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1230         * platform/graphics/texmap/TextureMapperLayer.cpp:
1231         * platform/graphics/texmap/TextureMapperLayer.h:
1232         Exclude GraphicsLayerTextureMapper from build when we are using Coordinated Graphics.
1233
1234         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: Added.
1235         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: Added.
1236         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp: Added.
1237         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: Added.
1238
1239         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1240         (WebCore::GraphicsLayer::create):
1241         Because we removed GraphicsLayerTextureMapper from build, we need to add own factory function.
1242
1243         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
1244         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
1245         (WebCore::CoordinatedGraphicsLayer::platformLayerWillBeDestroyed):
1246         (WebCore::CoordinatedGraphicsLayer::setPlatformLayerNeedsDisplay):
1247         Implements sync operations for TextureMapperPlatformLayerProxy
1248
1249 2015-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1250
1251         Fix GTK+ build with GStreamer GL
1252         https://bugs.webkit.org/show_bug.cgi?id=151939
1253
1254         Reviewed by Žan Doberšek.
1255
1256         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1257         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1258         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
1259         (WebCore::MediaPlayerPrivateGStreamerBase::drawCallback):
1260         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1261
1262 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
1263
1264         Show more information about SVG renderers in showLayerTree() output
1265         https://bugs.webkit.org/show_bug.cgi?id=151930
1266
1267         Reviewed by Zalan Bujtas.
1268         
1269         In showLayerTree() output, for SVG renderers show:
1270         - visual and layout overflow, for boxes
1271         - frame rect, for boxes
1272         - layout state
1273         - class and id
1274
1275         * rendering/RenderLayer.cpp:
1276         (WebCore::showLayerTree):
1277         * rendering/RenderTreeAsText.cpp:
1278         (WebCore::RenderTreeAsText::writeRenderObject):
1279         (WebCore::writeDebugInfo): New function to share dumping with svg output.
1280         (WebCore::write):
1281         * rendering/RenderTreeAsText.h:
1282         * rendering/svg/SVGRenderTreeAsText.cpp:
1283         (WebCore::writePositionAndStyle): Show the frameRect for boxes (e.g. RenderSVGRoot).
1284         Much more useful that showing the clippedOverflowRect.
1285         (WebCore::writeStandardPrefix):
1286         (WebCore::writeChildren):
1287         (WebCore::writeSVGResourceContainer):
1288         (WebCore::writeSVGContainer):
1289         (WebCore::write):
1290         (WebCore::writeSVGText):
1291         (WebCore::writeSVGInlineText):
1292         (WebCore::writeSVGImage):
1293         (WebCore::writeSVGGradientStop):
1294         (WebCore::writeResources):
1295         (WebCore::operator<<): Deleted.
1296         * rendering/svg/SVGRenderTreeAsText.h:
1297
1298 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
1299
1300         Clipping along compositing borders in svg-edit
1301         https://bugs.webkit.org/show_bug.cgi?id=151791
1302
1303         Reviewed by Zalan Bujtas.
1304         
1305         RenderSVGRoot::layout() failed to clear overflow before recomputing
1306         visual overflow, which could cause it to get stuck with stale overflow.
1307         This would cause underpainting if its size went from small to large.
1308
1309         Test: svg/overflow/visual-overflow-change.html
1310
1311         * rendering/svg/RenderSVGRoot.cpp:
1312         (WebCore::RenderSVGRoot::layout):
1313
1314 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
1315
1316         REGRESSION (r187121): Can't get to the main content of the page at https://theintercept.com/drone-papers/
1317         https://bugs.webkit.org/show_bug.cgi?id=151849
1318         rdar://problem/23132828
1319
1320         Reviewed by Zalan Bujtas.
1321         
1322         This page uses a fill-forwards animation where the last keyframe has height: auto.
1323         After r187121, we tried to blend the height Length value from the last keyframe to the
1324         first keyframe with progress=0 (which should pick up the 'auto' from the last keyframe).
1325         
1326         However, Length::blend() just considered both 0 and 'auto' to be zero, and returned
1327         the 0 length.
1328         
1329         So fix Length::blend() to return the "from" length if progress is zero.
1330
1331         Test: animations/fill-forwards-auto-height.html
1332
1333         * page/animation/CSSPropertyAnimation.cpp:
1334         (WebCore::blendFunc): Length::blend takes a double, so don't narrow to float.
1335         * page/animation/KeyframeAnimation.cpp:
1336         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Declare two variables
1337         at first use.
1338         * platform/Length.h:
1339         (WebCore::Length::blend):
1340
1341 2015-12-06  Simon Fraser  <simon.fraser@apple.com>
1342
1343         Give SVGTransformList some inline vector capacity
1344         https://bugs.webkit.org/show_bug.cgi?id=151644
1345
1346         Reviewed by Andreas Kling.
1347
1348         Giving SVGTransformList inline capacity of one drops time under SVGTransformList::parse() by
1349         about 1% on http://animateplus.com/demos/stress-test/
1350
1351         * svg/SVGTransformList.h:
1352
1353 2015-12-06  Zalan Bujtas  <zalan@apple.com>
1354
1355         Addressing post-review comments on r193374.
1356
1357         Reviewed by Antti Koivisto.
1358
1359         * rendering/SimpleLineLayout.cpp:
1360         (WebCore::SimpleLineLayout::canUseForText):
1361         (WebCore::SimpleLineLayout::canUseForFontAndText):
1362         (WebCore::SimpleLineLayout::canUseForStyle):
1363         (WebCore::SimpleLineLayout::canUseForWithReason):
1364         (WebCore::SimpleLineLayout::canUseFor):
1365         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
1366         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1367
1368 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
1369
1370         Remove CORETEXT_WEB_FONTS
1371         https://bugs.webkit.org/show_bug.cgi?id=151891
1372
1373         Reviewed by Simon Fraser.
1374
1375         The only platform where this was turned off (Mavericks) is no longer supported.
1376
1377         No new tests because there is no behavior difference.
1378
1379         * platform/graphics/cocoa/FontCocoa.mm:
1380         (WebCore::Font::platformCreateScaledFont): Deleted.
1381         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1382         (WebCore::FontPlatformData::registeredFont):
1383         (WebCore::FontPlatformData::ctFont):
1384         * platform/graphics/mac/FontCustomPlatformData.cpp:
1385         (WebCore::FontCustomPlatformData::fontPlatformData): Deleted.
1386         (WebCore::createFontCustomPlatformData): Deleted.
1387         * platform/graphics/mac/FontCustomPlatformData.h:
1388         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Deleted.
1389         * platform/text/TextFlags.h:
1390
1391 2015-12-04  Zalan Bujtas  <zalan@apple.com>
1392
1393         Garbage in page tiles when document is too long.
1394         https://bugs.webkit.org/show_bug.cgi?id=151906
1395         rdar://problem/23695858
1396
1397         Reviewed by Simon Fraser.
1398
1399         This patch partially fixes the broken concept(webkit.org/b/151908) of having a nearlyMax/2 sized rectangle to define infiniteness.
1400         (see LayoutRect::infiniteRect() and ClipRect::isInfinite())
1401
1402         Covered by existing test.
1403
1404         * rendering/ClipRect.h: Branch for infinite clipping.
1405         (WebCore::ClipRect::intersect):
1406         (WebCore::ClipRect::intersects):
1407         * rendering/RenderLayer.cpp:
1408         (WebCore::RenderLayer::clipToRect): Do not clip when clipping is infinite.
1409         (WebCore::RenderLayer::restoreClip):
1410         (WebCore::RenderLayer::calculateClipRects):
1411
1412 2015-12-04  Brady Eidson  <beidson@apple.com>
1413
1414         Modern IDB: Add some more custom exception messages, passing some more tests.
1415         https://bugs.webkit.org/show_bug.cgi?id=151898
1416
1417         Reviewed by Alex Christensen.
1418
1419         No new tests (Some failing tests now pass).
1420
1421         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1422         (WebCore::IDBClient::IDBTransaction::objectStore):
1423
1424 2015-12-04  Brent Fulgham  <bfulgham@apple.com>
1425
1426         Place an upper bound on canvas pixel count
1427         https://bugs.webkit.org/show_bug.cgi?id=151825
1428         <rdar://problem/23324916>
1429
1430         Reviewed by Simon Fraser.
1431
1432         Malformed JavaScript can attempt to create lots of canvas contexts. Limit the amount of memory
1433         we will use for this purpose to some percentage of system RAM.
1434
1435         * html/HTMLCanvasElement.cpp:
1436         (WebCore::removeFromActivePixelMemory): Added helper function
1437         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Call new 'releaseImageBufferAndContext' method
1438         to ensure ImageBuffer and graphics context state are properly cleaned up.
1439         (WebCore::maxActivePixels): Use one quarter of the system RAM, or 1 GB (whichever is more) as
1440         an upper bound on active pixel memory.
1441         (WebCore::HTMLCanvasElement::getContext): If we are attempting to create a context that will cause
1442         us to exceed the allowed active pixel count, fail.
1443         (WebCore::HTMLCanvasElement::releaseImageBufferAndContext): Added helper function
1444         (WebCore::HTMLCanvasElement::setSurfaceSize): Use the new 'releaseImageBufferAndContext' method
1445         to handle active pixel memory counts.
1446         (WebCore::HTMLCanvasElement::createImageBuffer): Refuse to create a backing buffer if it will
1447         exceed our available pixel memory.
1448
1449 2015-12-04  Brady Eidson  <beidson@apple.com>
1450
1451         Modern IDB: Add some more custom exception messages, passing some more tests.
1452         https://bugs.webkit.org/show_bug.cgi?id=151895
1453
1454         Reviewed by Alex Christensen.
1455
1456         No new tests (Some failing tests now pass).
1457
1458         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1459         (WebCore::IDBClient::IDBDatabase::transaction):
1460
1461         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1462         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
1463
1464 2015-12-04  Jonathan Davis  <jond@apple.com>
1465
1466         Update feature status for up-to-date status information.
1467         https://bugs.webkit.org/show_bug.cgi?id=151821
1468
1469         Reviewed by Timothy Hatcher.
1470
1471         * features.json:
1472
1473 2015-12-04  Brady Eidson  <beidson@apple.com>
1474
1475         Modern IDB: Flip test expectations around so we only list failures.
1476         https://bugs.webkit.org/show_bug.cgi?id=151880
1477
1478         Reviewed by Alex Christensen.
1479
1480         No new tests (Covered by all existing tests).
1481
1482         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1483         (WebCore::IDBClient::IDBRequest::stop):
1484         (WebCore::IDBClient::IDBRequest::enqueueEvent):
1485         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1486         * Modules/indexeddb/client/IDBRequestImpl.h:
1487         
1488         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1489         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
1490         (WebCore::IDBClient::IDBTransaction::hasPendingActivity):
1491         (WebCore::IDBClient::IDBTransaction::stop):
1492         (WebCore::IDBClient::IDBTransaction::enqueueEvent):
1493         (WebCore::IDBClient::IDBTransaction::dispatchEvent):
1494         * Modules/indexeddb/client/IDBTransactionImpl.h:
1495         
1496         * bindings/js/IDBBindingUtilities.cpp:
1497         (WebCore::idbKeyToScriptValue): Protection against a ScriptExecutionContext that no longer has an ExecState.
1498           A full reworking on the binding utilities to prevent this through is covered by b/151890
1499
1500 2015-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
1501
1502         [Cocoa] Some fonts cause CTFontCopyAvailableTables() to return nullptr
1503         https://bugs.webkit.org/show_bug.cgi?id=151884
1504         <rdar://problem/23752253>
1505
1506         Reviewed by Brian Burg.
1507
1508         No new tests.
1509
1510         * platform/graphics/opentype/OpenTypeCG.cpp:
1511         (WebCore::OpenType::fontHasMathTable):
1512
1513 2015-12-04  Jer Noble  <jer.noble@apple.com>
1514
1515         Unreviewed build-fix; Add new parameter to overloaded createSession() method in MediaPlayerPrivateAVFoundationCF.
1516
1517         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1518         (WebCore::CDMSessionAVFoundationCF::CDMSessionAVFoundationCF):
1519         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1520         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1521         (WebCore::MediaPlayerPrivateAVFoundationCF::createSession):
1522         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1523
1524 2015-12-01  Jer Noble  <jer.noble@apple.com>
1525
1526         Adopt AVContentKeySession
1527         https://bugs.webkit.org/show_bug.cgi?id=151221
1528
1529         Reviewed by Eric Carlson.
1530
1531         Adopt a new API for managing key state, AVContentKeySession. Because this necessitates a change
1532         in both the initialization data returned by the needkey event, and passed into the createSession()
1533         method, bump the protocol version number (to 3), and keep supporting the old key management API
1534         for legacy content.
1535
1536         To do so, move most of the implementation of CDMPrivateMediaSourceAVFObjC into a new subclass,
1537         CDMSessionAVStreamSession, and add a new subclass, CDMSessionAVContentKeySession, to support the
1538         new API.
1539
1540         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1541         (WebCore::CDMPrivateMediaSourceAVFObjC::CDMPrivateMediaSourceAVFObjC): Moved to implementation file.
1542         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1543         (WebCore::validKeySystemRE): Support "com.apple.fps.3_x".
1544         (WebCore::CDMPrivateMediaSourceAVFObjC::~CDMPrivateMediaSourceAVFObjC): Invalidate all outstanding sessions.
1545         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem): Only support "com.apple.fps.3_x" if the AVContentKeySession class is available.
1546         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): Create an instance of CDMSessionAVContentKeySession if "com.apple.fps.3_x" is specified and AVContentKeySession is available.
1547         (WebCore::CDMPrivateMediaSourceAVFObjC::invalidateSession): Remove session from the list of outstanding sessions.
1548         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Deleted.
1549         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
1550         (WebCore::CDMSessionAVContentKeySession::hasContentKeySession): Simple accessor.
1551         (WebCore::toCDMSessionAVContentKeySession): Safe casting.
1552         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Added.
1553         (-[CDMSessionAVContentKeySessionDelegate initWithParent:]): Simple constructor.
1554         (-[CDMSessionAVContentKeySessionDelegate invalidate]): Remove reference to parent.
1555         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:willProvideKeyRequestInitializationDataForTrackID:]): Pass to parent.
1556         (-[CDMSessionAVContentKeySessionDelegate contentKeySession:didProvideKeyRequestInitializationData:requestHandling:]): Ditto.
1557         (-[CDMSessionAVContentKeySessionDelegate contentKeySessionContentProtectionSessionIdentifierDidChange:]): Ditto.
1558         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession): Create the delegate.
1559         (WebCore::CDMSessionAVContentKeySession::~CDMSessionAVContentKeySession): Invalidate the delegate and remove all parsers.
1560         (WebCore::CDMSessionAVContentKeySession::isAvailable): Return true if AVContentKeySession class is available.
1561         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest): Support "keyrelease" message, setting of the certificate, and creating key request object. 
1562         (WebCore::CDMSessionAVContentKeySession::releaseKeys): Retrieve keys from storage location.
1563         (WebCore::isEqual): Compares a Uint8Array to a char*.
1564         (WebCore::CDMSessionAVContentKeySession::update): Support "acknowledged" message, "renew" message, and key addition.
1565         (WebCore::CDMSessionAVContentKeySession::addParser): Add the parser to the AVContentKeySession.
1566         (WebCore::CDMSessionAVContentKeySession::removeParser): Remove parser from same.
1567         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): Retrieve key release message from AVContentKeySession.
1568         (WebCore::CDMSessionAVContentKeySession::didProvideContentKeyRequest): Simple setter.
1569         (WebCore::CDMSessionAVContentKeySession::contentKeySession): Lazily create the AVContentKeySession.
1570         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1571         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1572         (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
1573         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h.
1574         (WebCore::toCDMSessionAVStreamSession):
1575         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Copied from Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm.
1576         (-[CDMSessionAVStreamSessionObserver initWithParent:]): Moved from CDMSessionMediaSourceAVFObjcObserver.
1577         (-[CDMSessionAVStreamSessionObserver contentProtectionSessionIdentifierChanged:]): Ditto.
1578         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession): Ditto.
1579         (WebCore::CDMSessionAVStreamSession::~CDMSessionAVStreamSession): Ditto.
1580         (WebCore::CDMSessionAVStreamSession::generateKeyRequest): Ditto.
1581         (WebCore::CDMSessionAVStreamSession::releaseKeys): Ditto.
1582         (WebCore::isEqual): Ditto.
1583         (WebCore::CDMSessionAVStreamSession::update): Ditto.
1584         (WebCore::CDMSessionAVStreamSession::setStreamSession): Ditto.
1585         (WebCore::CDMSessionAVStreamSession::addParser): Ditto.
1586         (WebCore::CDMSessionAVStreamSession::removeParser): Ditto.
1587         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): Ditto.
1588         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1589         (WebCore::CDMSessionMediaSourceAVFObjC::invalidateCDM): Clear the m_cdm.
1590         (WebCore::toCDMSessionMediaSourceAVFObjC):
1591         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1592         (WebCore::CDMSessionMediaSourceAVFObjC::CDMSessionMediaSourceAVFObjC):
1593         (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): Instruct our CDM to invalidate their references to us.
1594         (WebCore::CDMSessionMediaSourceAVFObjC::addSourceBuffer): Call addParser().
1595         (WebCore::CDMSessionMediaSourceAVFObjC::removeSourceBuffer): Call removeParser().
1596         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Deleted.
1597         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Deleted.
1598         
1599         To give us a chance to create a CDMPrivate before we continue decoding media data, "block" further decoding
1600         on the background thread by creating a semaphore and passing it to the main thread, to be triggered when
1601         a CDM is created and attached to this source buffer.
1602
1603         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1604         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1605         (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
1606         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1607         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1608         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1609         (WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
1610         (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): Deleted.
1611         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1612
1613         Drive-by fix: Only throw an error from keyRequestTimerFired() if the underlying call to
1614         generateKeyRequest() returned an error, rather than just failed to create a message.
1615
1616         * Modules/encryptedmedia/MediaKeySession.cpp:
1617         (WebCore::MediaKeySession::keyRequestTimerFired):
1618
1619         Drive-by fix: Pass the CDMSessionClient into CDM::createSession() so that it is immediately available
1620         in the CDMSessionPrivate constructor, rather than setting the client immediately after construction.
1621
1622         * Modules/encryptedmedia/CDM.cpp:
1623         (WebCore::CDM::createSession):
1624         * Modules/encryptedmedia/CDM.h:
1625         * Modules/encryptedmedia/CDMPrivate.h:
1626         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
1627         (WebCore::CDMPrivateClearKey::createSession):
1628         * Modules/encryptedmedia/CDMPrivateClearKey.h:
1629         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
1630         (WebCore::CDMPrivateMediaPlayer::createSession):
1631         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
1632         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1633         (WebCore::CDMSessionClearKey::CDMSessionClearKey):
1634         * Modules/encryptedmedia/CDMSessionClearKey.h:
1635         * Modules/encryptedmedia/MediaKeySession.cpp:
1636         (WebCore::MediaKeySession::MediaKeySession):
1637         * platform/graphics/CDMSession.h:
1638         * platform/graphics/MediaPlayer.cpp:
1639         (WebCore::MediaPlayer::createSession):
1640         * platform/graphics/MediaPlayer.h:
1641         * platform/graphics/MediaPlayerPrivate.h:
1642         (WebCore::MediaPlayerPrivateInterface::createSession):
1643         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1644         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1645         (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
1646         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1647         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmSession):
1648         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1649         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
1650         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::keyNeeded): Deleted.
1651         * testing/MockCDM.cpp:
1652         (WebCore::MockCDM::createSession):
1653         (WebCore::MockCDMSession::MockCDMSession):
1654         * testing/MockCDM.h:
1655
1656         Add new files to the project:
1657
1658         * WebCore.xcodeproj/project.pbxproj:
1659
1660
1661 2015-12-04  Brady Eidson  <beidson@apple.com>
1662
1663         Modern IDB: storage/indexeddb/cursor-update.html fails.
1664         https://bugs.webkit.org/show_bug.cgi?id=151879
1665
1666         Reviewed by Oliver Hunt.
1667
1668         No new tests (At least one failing test now passes).
1669
1670         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1671         (WebCore::IDBClient::IDBRequest::IDBRequest):
1672
1673 2015-12-04  Brady Eidson  <beidson@apple.com>
1674
1675         Modern IDB: storage/indexeddb/version-change-exclusive.html fails
1676         https://bugs.webkit.org/show_bug.cgi?id=151870
1677
1678         Reviewed by Alex Christensen.
1679
1680         Test: storage/indexeddb/modern/double-open.html
1681               storage/indexeddb/version-change-exclusive.html
1682
1683         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1684         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Delay handling open operations
1685           while the first is still in progress.
1686         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1687         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1688
1689 2015-12-04  Brady Eidson  <beidson@apple.com>
1690
1691         Modern IDB: storage/indexeddb/exceptions.html fails.
1692         https://bugs.webkit.org/show_bug.cgi?id=151732
1693
1694         Reviewed by Alex Christensen.
1695
1696         No new tests (At least one failing test now passes).
1697
1698         - Lots of customized exception messages for IDB code to match the text expectations.
1699         - Updates to the test expectations where we can't/won't match them exactly.
1700         - And a couple of little required behavior changes exposed by the test
1701
1702         * Modules/indexeddb/IDBCursor.h:
1703         * Modules/indexeddb/IDBCursor.idl:
1704         * Modules/indexeddb/IDBDatabase.h:
1705         * Modules/indexeddb/IDBDatabase.idl:
1706         * Modules/indexeddb/IDBDatabaseException.cpp:
1707         (WebCore::IDBDatabaseException::initializeDescription):
1708         * Modules/indexeddb/IDBFactory.h:
1709         * Modules/indexeddb/IDBFactory.idl:
1710         * Modules/indexeddb/IDBIndex.h:
1711         * Modules/indexeddb/IDBIndex.idl:
1712         * Modules/indexeddb/IDBObjectStore.h:
1713         * Modules/indexeddb/IDBObjectStore.idl:
1714         * Modules/indexeddb/IDBRequest.h:
1715         * Modules/indexeddb/IDBRequest.idl:
1716         * Modules/indexeddb/IDBTransaction.h:
1717         * Modules/indexeddb/IDBTransaction.idl:
1718         
1719         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1720         (WebCore::IDBClient::IDBCursor::update):
1721         (WebCore::IDBClient::IDBCursor::advance):
1722         (WebCore::IDBClient::IDBCursor::continueFunction):
1723         (WebCore::IDBClient::IDBCursor::deleteFunction):
1724         * Modules/indexeddb/client/IDBCursorImpl.h:
1725         
1726         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1727         (WebCore::IDBClient::IDBDatabase::createObjectStore):
1728         (WebCore::IDBClient::IDBDatabase::transaction):
1729         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
1730         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1731         
1732         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1733         (WebCore::IDBClient::IDBFactory::cmp):
1734         * Modules/indexeddb/client/IDBFactoryImpl.h:
1735         
1736         * Modules/indexeddb/client/IDBIndexImpl.cpp:
1737         (WebCore::IDBClient::IDBIndex::openCursor):
1738         (WebCore::IDBClient::IDBIndex::count):
1739         (WebCore::IDBClient::IDBIndex::doCount):
1740         (WebCore::IDBClient::IDBIndex::openKeyCursor):
1741         (WebCore::IDBClient::IDBIndex::get):
1742         (WebCore::IDBClient::IDBIndex::doGet):
1743         (WebCore::IDBClient::IDBIndex::getKey):
1744         (WebCore::IDBClient::IDBIndex::doGetKey):
1745         * Modules/indexeddb/client/IDBIndexImpl.h:
1746         
1747         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1748         (WebCore::IDBClient::IDBObjectStore::openCursor):
1749         (WebCore::IDBClient::IDBObjectStore::get):
1750         (WebCore::IDBClient::IDBObjectStore::add):
1751         (WebCore::IDBClient::IDBObjectStore::put):
1752         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
1753         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
1754         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
1755         (WebCore::IDBClient::IDBObjectStore::clear):
1756         (WebCore::IDBClient::IDBObjectStore::createIndex):
1757         (WebCore::IDBClient::IDBObjectStore::index):
1758         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
1759         (WebCore::IDBClient::IDBObjectStore::count):
1760         (WebCore::IDBClient::IDBObjectStore::doCount):
1761         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1762
1763         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1764         (WebCore::IDBClient::IDBRequest::result):
1765         (WebCore::IDBClient::IDBRequest::error):
1766         * Modules/indexeddb/client/IDBRequestImpl.h:
1767
1768         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1769         (WebCore::IDBClient::IDBTransaction::objectStore):
1770         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
1771         (WebCore::IDBClient::IDBTransaction::abort):
1772         * Modules/indexeddb/client/IDBTransactionImpl.h:
1773
1774         * Modules/indexeddb/legacy/LegacyCursor.cpp:
1775         (WebCore::LegacyCursor::update):
1776         (WebCore::LegacyCursor::continueFunction):
1777         (WebCore::LegacyCursor::deleteFunction):
1778         * Modules/indexeddb/legacy/LegacyCursor.h:
1779
1780         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
1781         (WebCore::LegacyDatabase::createObjectStore):
1782         (WebCore::LegacyDatabase::deleteObjectStore):
1783         (WebCore::LegacyDatabase::transaction):
1784         (WebCore::LegacyDatabase::forceClose):
1785         * Modules/indexeddb/legacy/LegacyDatabase.h:
1786
1787         * Modules/indexeddb/legacy/LegacyFactory.cpp:
1788         (WebCore::LegacyFactory::cmp):
1789         * Modules/indexeddb/legacy/LegacyFactory.h:
1790
1791         * Modules/indexeddb/legacy/LegacyIndex.cpp:
1792         (WebCore::LegacyIndex::openCursor):
1793         (WebCore::LegacyIndex::count):
1794         (WebCore::LegacyIndex::openKeyCursor):
1795         (WebCore::LegacyIndex::get):
1796         (WebCore::LegacyIndex::getKey):
1797         * Modules/indexeddb/legacy/LegacyIndex.h:
1798
1799         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
1800         (WebCore::LegacyObjectStore::get):
1801         (WebCore::LegacyObjectStore::add):
1802         (WebCore::LegacyObjectStore::put):
1803         (WebCore::LegacyObjectStore::deleteFunction):
1804         (WebCore::LegacyObjectStore::clear):
1805         (WebCore::LegacyObjectStore::createIndex):
1806         (WebCore::LegacyObjectStore::index):
1807         (WebCore::LegacyObjectStore::deleteIndex):
1808         (WebCore::LegacyObjectStore::openCursor):
1809         (WebCore::LegacyObjectStore::count):
1810         * Modules/indexeddb/legacy/LegacyObjectStore.h:
1811         (WebCore::LegacyObjectStore::createIndex):
1812         (WebCore::LegacyObjectStore::count):
1813
1814         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1815         (WebCore::LegacyRequest::result):
1816         (WebCore::LegacyRequest::error):
1817         (WebCore::LegacyRequest::dispatchEvent):
1818         (WebCore::LegacyRequest::uncaughtExceptionInEventHandler):
1819         * Modules/indexeddb/legacy/LegacyRequest.h:
1820
1821         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
1822         (WebCore::LegacyTransaction::objectStore):
1823         (WebCore::LegacyTransaction::abort):
1824         (WebCore::LegacyTransaction::stop):
1825         * Modules/indexeddb/legacy/LegacyTransaction.h:
1826
1827         * bindings/js/JSDOMBinding.cpp:
1828         (WebCore::createDOMException): For IDBDatabase exceptions, use createWithDescriptionAsMessage
1829
1830         * bindings/js/JSIDBDatabaseCustom.cpp:
1831         (WebCore::JSIDBDatabase::createObjectStore):
1832         (WebCore::JSIDBDatabase::transaction):
1833
1834         * bindings/js/JSIDBObjectStoreCustom.cpp:
1835         (WebCore::putOrAdd):
1836         (WebCore::JSIDBObjectStore::createIndex):
1837
1838         * dom/DOMCoreException.h:
1839         (WebCore::DOMCoreException::createWithDescriptionAsMessage): Create an exception whose message
1840           is the description.
1841         (WebCore::DOMCoreException::DOMCoreException):
1842
1843         * dom/ExceptionBase.cpp:
1844         (WebCore::ExceptionBase::ExceptionBase): Add a flag to determine where the message comes from
1845         * dom/ExceptionBase.h:
1846
1847         * dom/make_dom_exceptions.pl:
1848         (generateHeader): Add an IDBDatabaseException type
1849
1850         * inspector/InspectorIndexedDBAgent.cpp:
1851
1852 2015-12-04  Joseph Pecoraro  <pecoraro@apple.com>
1853
1854         Web Inspector: Remove untested and unused Worker inspection
1855         https://bugs.webkit.org/show_bug.cgi?id=151848
1856
1857         Reviewed by Brian Burg.
1858
1859         * CMakeLists.txt:
1860         * WebCore.vcxproj/WebCore.vcxproj:
1861         * WebCore.vcxproj/WebCore.vcxproj.filters:
1862         * WebCore.xcodeproj/project.pbxproj:
1863         * bindings/js/JSBindingsAllInOne.cpp:
1864         * bindings/js/WorkerScriptController.cpp:
1865         * bindings/js/WorkerScriptDebugServer.cpp: Removed.
1866         * bindings/js/WorkerScriptDebugServer.h: Removed.
1867         * inspector/InspectorAllInOne.cpp:
1868         * inspector/InspectorConsoleInstrumentation.h:
1869         (WebCore::InspectorInstrumentation::addMessageToConsole):
1870         * inspector/InspectorController.cpp:
1871         (WebCore::InspectorController::InspectorController): Deleted.
1872         * inspector/InspectorInstrumentation.cpp:
1873         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStartImpl): Deleted.
1874         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScopeImpl): Deleted.
1875         (WebCore::InspectorInstrumentation::willEvaluateWorkerScript): Deleted.
1876         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminatedImpl): Deleted.
1877         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope): Deleted.
1878         (WebCore::InspectorInstrumentation::instrumentingAgentsForNonDocumentContext): Deleted.
1879         * inspector/InspectorInstrumentation.h:
1880         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
1881         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart): Deleted.
1882         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScope): Deleted.
1883         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminated): Deleted.
1884         * inspector/InspectorTimelineAgent.h:
1885         * inspector/InspectorWebAgentBase.h:
1886         (WebCore::WorkerAgentContext::WorkerAgentContext): Deleted.
1887         * inspector/InspectorWorkerAgent.cpp: Removed.
1888         * inspector/InspectorWorkerAgent.h: Removed.
1889         * inspector/InspectorWorkerResource.h: Removed.
1890         * inspector/InstrumentingAgents.cpp:
1891         (WebCore::InstrumentingAgents::reset): Deleted.
1892         * inspector/InstrumentingAgents.h:
1893         (WebCore::InstrumentingAgents::workerRuntimeAgent): Deleted.
1894         (WebCore::InstrumentingAgents::setWorkerRuntimeAgent): Deleted.
1895         (WebCore::InstrumentingAgents::inspectorWorkerAgent): Deleted.
1896         (WebCore::InstrumentingAgents::setInspectorWorkerAgent): Deleted.
1897         * inspector/PageConsoleAgent.h:
1898         * inspector/PageScriptDebugServer.cpp:
1899         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
1900         * inspector/WorkerConsoleAgent.cpp: Removed.
1901         * inspector/WorkerConsoleAgent.h: Removed.
1902         * inspector/WorkerDebuggerAgent.cpp: Removed.
1903         * inspector/WorkerDebuggerAgent.h: Removed.
1904         * inspector/WorkerInspectorController.cpp: Removed.
1905         * inspector/WorkerInspectorController.h: Removed.
1906         * inspector/WorkerRuntimeAgent.cpp: Removed.
1907         * inspector/WorkerRuntimeAgent.h: Removed.
1908         * workers/Worker.cpp:
1909         (WebCore::Worker::notifyFinished): Deleted.
1910         * workers/WorkerGlobalScope.cpp:
1911         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Deleted.
1912         (WebCore::WorkerGlobalScope::~WorkerGlobalScope): Deleted.
1913         * workers/WorkerGlobalScope.h:
1914         (WebCore::WorkerGlobalScope::workerInspectorController): Deleted.
1915         * workers/WorkerGlobalScopeProxy.h:
1916         (WebCore::WorkerGlobalScopeProxy::PageInspector::~PageInspector): Deleted.
1917         (WebCore::WorkerGlobalScopeProxy::connectToInspector): Deleted.
1918         (WebCore::WorkerGlobalScopeProxy::disconnectFromInspector): Deleted.
1919         (WebCore::WorkerGlobalScopeProxy::sendMessageToInspector): Deleted.
1920         * workers/WorkerMessagingProxy.cpp:
1921         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy): Deleted.
1922         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Deleted.
1923         (WebCore::WorkerMessagingProxy::connectToInspector): Deleted.
1924         (WebCore::WorkerMessagingProxy::disconnectFromInspector): Deleted.
1925         (WebCore::WorkerMessagingProxy::sendMessageToInspector): Deleted.
1926         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal): Deleted.
1927         (WebCore::WorkerMessagingProxy::terminateWorkerGlobalScope): Deleted.
1928         (WebCore::WorkerMessagingProxy::postMessageToPageInspector): Deleted.
1929         * workers/WorkerMessagingProxy.h:
1930         * workers/WorkerReportingProxy.h:
1931         * workers/WorkerThread.cpp:
1932         (WebCore::WorkerThread::workerThread): Deleted.
1933
1934 2015-12-03  Sergio Villar Senin  <svillar@igalia.com>
1935
1936         [css-grid] Fix height computation of grid items with borders inside fr tracks
1937         https://bugs.webkit.org/show_bug.cgi?id=151798
1938
1939         Reviewed by Zalan Bujtas.
1940
1941         Since r192154 we run a second pass of the track sizing
1942         algorithm whenever the height of the grid is indefinite in
1943         order to properly compute row sizes. The available space
1944         passed to the track sizing algorithm must not contain neither
1945         borders nor paddings, otherwise it will think that it has more
1946         space available than the existing one. We should use the
1947         height of the content box instead.
1948
1949         Test: fast/css-grid-layout/grid-item-with-border-in-fr.html
1950
1951         * rendering/RenderGrid.cpp:
1952         (WebCore::RenderGrid::layoutBlock):
1953
1954 2015-12-03  Brady Eidson  <beidson@apple.com>
1955
1956         Modern IDB: storage/indexeddb/cursor-index-delete.html fails.
1957         https://bugs.webkit.org/show_bug.cgi?id=151847
1958
1959         Reviewed by Andy Estes.
1960
1961         No new tests (At least one failing test now passes).
1962
1963         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1964         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
1965         (WebCore::IDBServer::MemoryIndexCursor::currentData):
1966
1967 2015-12-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1968
1969         Reduce uses of PassRefPtr in DOM - 1
1970         https://bugs.webkit.org/show_bug.cgi?id=149788
1971
1972         Reviewed by Darin Adler.
1973
1974         As a step to purge PassRefPtr, this patch reduces the uses in WebCore/dom.
1975
1976         * dom/ChildListMutationScope.cpp:
1977         (WebCore::ChildListMutationAccumulator::getOrCreate):
1978         * dom/ChildListMutationScope.h:
1979         * dom/ClipboardEvent.cpp:
1980         (WebCore::ClipboardEvent::ClipboardEvent):
1981         * dom/ClipboardEvent.h:
1982         * dom/CompositionEvent.cpp:
1983         (WebCore::CompositionEvent::CompositionEvent):
1984         (WebCore::CompositionEvent::initCompositionEvent):
1985         * dom/CompositionEvent.h:
1986         * dom/DOMNamedFlowCollection.cpp:
1987         (WebCore::DOMNamedFlowCollection::item):
1988         * dom/DOMNamedFlowCollection.h:
1989         * dom/DOMStringList.h:
1990         * dom/DeviceMotionController.cpp:
1991         (WebCore::DeviceMotionController::getLastEvent):
1992         * dom/DeviceMotionController.h:
1993         * dom/DeviceOrientationController.cpp:
1994         (WebCore::DeviceOrientationController::getLastEvent):
1995         * dom/DeviceOrientationController.h:
1996         * editing/Editor.cpp:
1997         (WebCore::Editor::dispatchCPPEvent):
1998         * page/DeviceController.h:
1999         (WebCore::DeviceController::getLastEvent):
2000
2001 2015-12-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
2002
2003         Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
2004         https://bugs.webkit.org/show_bug.cgi?id=151829
2005
2006         Reviewed by Simon Fraser.
2007
2008         Set the CTM of the GraphicsContext to its original value before changing
2009         it. This is a lot cheaper than using GraphicsContextStateSaver to save the
2010         whole state of the GraphicsContext and restore it back;
2011
2012         * rendering/RenderLayer.cpp:
2013         (WebCore::RenderLayer::paintLayerByApplyingTransform):
2014
2015 2015-12-03  Eric Carlson  <eric.carlson@apple.com>
2016
2017         [MediaStream] Update MediaStreamTrack.getCapabilities
2018         https://bugs.webkit.org/show_bug.cgi?id=151728
2019
2020         Reviewed by Jer Noble.
2021
2022         Test: fast/mediastream/MediaStreamTrack-getCapabilities.html
2023
2024         * CMakeLists.txt: Remove files deleted from the repository.
2025
2026         * DerivedSources.make: Ditto.
2027
2028         * Modules/mediastream/AllAudioCapabilities.h: Removed.
2029         * Modules/mediastream/AllAudioCapabilities.idl: Removed.
2030         * Modules/mediastream/AllVideoCapabilities.h: Removed.
2031         * Modules/mediastream/AllVideoCapabilities.idl: Removed.
2032         * Modules/mediastream/CapabilityRange.cpp: Removed.
2033         * Modules/mediastream/CapabilityRange.h: Removed.
2034         * Modules/mediastream/CapabilityRange.idl: Removed.
2035
2036         * Modules/mediastream/MediaSourceSettings.h:
2037         (WebCore::MediaSourceSettings::supportsVolume): Volume is a double.
2038         (WebCore::MediaSourceSettings::volume): Double.
2039
2040         * Modules/mediastream/MediaStreamCapabilities.cpp: Removed.
2041         * Modules/mediastream/MediaStreamCapabilities.h: Removed.
2042         * Modules/mediastream/MediaStreamCapabilities.idl: Removed.
2043
2044         * Modules/mediastream/MediaStreamTrack.cpp:
2045         (WebCore::MediaStreamTrack::getCapabilities): MediaStreamCapabilities is gone, return a RealtimeMediaSourceCapabilities.
2046         * Modules/mediastream/MediaStreamTrack.h:
2047         * Modules/mediastream/MediaStreamTrack.idl:
2048
2049         * WebCore.xcodeproj/project.pbxproj: Remove files deleted from the repository.
2050         * bindings/js/JSMediaStreamTrackCustom.cpp:
2051         (WebCore::capabilityValue):
2052         (WebCore::JSMediaStreamTrack::getCapabilities): Create and return a dictionary of capatilities.
2053
2054         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
2055         (WebCore::CapabilityValueOrRange::type):
2056         (WebCore::CapabilityValueOrRange::CapabilityValueOrRange):
2057         (WebCore::CapabilityValueOrRange::rangeMin):
2058         (WebCore::CapabilityValueOrRange::rangeMax):
2059         (WebCore::CapabilityValueOrRange::value):
2060         (WebCore::RealtimeMediaSourceCapabilities::create):
2061         (WebCore::RealtimeMediaSourceCapabilities::~RealtimeMediaSourceCapabilities):
2062         (WebCore::RealtimeMediaSourceCapabilities::supportsWidth):
2063         (WebCore::RealtimeMediaSourceCapabilities::width):
2064         (WebCore::RealtimeMediaSourceCapabilities::setWidth):
2065         (WebCore::RealtimeMediaSourceCapabilities::supportsHeight):
2066         (WebCore::RealtimeMediaSourceCapabilities::height):
2067         (WebCore::RealtimeMediaSourceCapabilities::setHeight):
2068         (WebCore::RealtimeMediaSourceCapabilities::supportsFrameRate):
2069         (WebCore::RealtimeMediaSourceCapabilities::frameRate):
2070         (WebCore::RealtimeMediaSourceCapabilities::setFrameRate):
2071         (WebCore::RealtimeMediaSourceCapabilities::supportsFacingMode):
2072         (WebCore::RealtimeMediaSourceCapabilities::facingMode):
2073         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode):
2074         (WebCore::RealtimeMediaSourceCapabilities::supportsAspectRatio):
2075         (WebCore::RealtimeMediaSourceCapabilities::aspectRatio):
2076         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatio):
2077         (WebCore::RealtimeMediaSourceCapabilities::supportsVolume):
2078         (WebCore::RealtimeMediaSourceCapabilities::volume):
2079         (WebCore::RealtimeMediaSourceCapabilities::setVolume):
2080         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleRate):
2081         (WebCore::RealtimeMediaSourceCapabilities::sampleRate):
2082         (WebCore::RealtimeMediaSourceCapabilities::setSampleRate):
2083         (WebCore::RealtimeMediaSourceCapabilities::supportsSampleSize):
2084         (WebCore::RealtimeMediaSourceCapabilities::sampleSize):
2085         (WebCore::RealtimeMediaSourceCapabilities::setSampleSize):
2086         (WebCore::RealtimeMediaSourceCapabilities::supportsEchoCancellation):
2087         (WebCore::RealtimeMediaSourceCapabilities::echoCancellation):
2088         (WebCore::RealtimeMediaSourceCapabilities::setEchoCancellation):
2089         (WebCore::RealtimeMediaSourceCapabilities::supportsDeviceId):
2090         (WebCore::RealtimeMediaSourceCapabilities::deviceId):
2091         (WebCore::RealtimeMediaSourceCapabilities::setDeviceId):
2092         (WebCore::RealtimeMediaSourceCapabilities::supportsGroupId):
2093         (WebCore::RealtimeMediaSourceCapabilities::groupId):
2094         (WebCore::RealtimeMediaSourceCapabilities::setGroupId):
2095         (WebCore::RealtimeMediaSourceCapabilities::RealtimeMediaSourceCapabilities):
2096         (WebCore::RealtimeMediaSourceCapabilityRange::RealtimeMediaSourceCapabilityRange): Deleted.
2097         (WebCore::RealtimeMediaSourceCapabilityRange::min): Deleted.
2098         (WebCore::RealtimeMediaSourceCapabilityRange::max): Deleted.
2099         (WebCore::RealtimeMediaSourceCapabilityRange::type): Deleted.
2100         (WebCore::RealtimeMediaSourceCapabilityRange::supported): Deleted.
2101         (WebCore::RealtimeMediaSourceCapabilities::sourceId): Deleted.
2102         (WebCore::RealtimeMediaSourceCapabilities::setSourceId): Deleted.
2103         (WebCore::RealtimeMediaSourceCapabilities::facingModes): Deleted.
2104         (WebCore::RealtimeMediaSourceCapabilities::setWidthRange): Deleted.
2105         (WebCore::RealtimeMediaSourceCapabilities::setHeightRange): Deleted.
2106         (WebCore::RealtimeMediaSourceCapabilities::setFrameRateRange): Deleted.
2107         (WebCore::RealtimeMediaSourceCapabilities::setAspectRatioRange): Deleted.
2108         (WebCore::RealtimeMediaSourceCapabilities::setVolumeRange): Deleted.
2109         (WebCore::RealtimeMediaSourceCapabilities::hasVideoSource): Deleted.
2110         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource): Deleted.
2111
2112         * platform/mediastream/RealtimeMediaSourceSettings.h:
2113         (WebCore::RealtimeMediaSourceSettings::volume): Volume is a double.
2114         (WebCore::RealtimeMediaSourceSettings::setVolume): Ditt.
2115
2116         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2117         (WebCore::AVAudioCaptureSource::initializeCapabilities): Initialize volume capability.
2118
2119         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2120         (WebCore::AVMediaCaptureSource::capabilities): RealtimeMediaSourceCapabilities constructor takes
2121           supportedConstraints. sourceId -> deviceId.
2122
2123         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2124         (WebCore::AVVideoCaptureSource::initializeCapabilities): DeviceId is set by the base class.
2125
2126         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm: Drive-by cleanup, remove unused code.
2127
2128         * platform/mock/MockRealtimeAudioSource.cpp:
2129         (WebCore::MockRealtimeAudioSource::initializeCapabilities): Updated.
2130         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Ditto.
2131
2132         * platform/mock/MockRealtimeMediaSource.cpp:
2133         (WebCore::MockRealtimeMediaSource::capabilities): sourceId -> deviceId.
2134
2135         * platform/mock/MockRealtimeVideoSource.cpp:
2136         (WebCore::MockRealtimeVideoSource::initializeCapabilities): Updated.
2137         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
2138
2139 2015-12-03  Simon Fraser  <simon.fraser@apple.com>
2140
2141         Have layer memory use consult the backing store format
2142         https://bugs.webkit.org/show_bug.cgi?id=151827
2143         rdar://problem/23746497
2144
2145         Reviewed by Dean Jackson.
2146         
2147         When computing the backing store memory size, take the pixel format into account,
2148         rather than assuming 4 bytes per pixel.
2149
2150         * platform/graphics/ca/GraphicsLayerCA.cpp:
2151         * platform/graphics/ca/PlatformCALayer.h:
2152
2153 2015-12-03  Anders Carlsson  <andersca@apple.com>
2154
2155         Remove Objective-C GC support
2156         https://bugs.webkit.org/show_bug.cgi?id=151819
2157         rdar://problem/23746991
2158
2159         Reviewed by Dan Bernstein.
2160
2161         * Configurations/Base.xcconfig:
2162         * bindings/objc/WebScriptObject.mm:
2163         (+[WebScriptObject initialize]): Deleted.
2164         (-[WebScriptObject finalize]): Deleted.
2165         * bindings/scripts/CodeGeneratorObjC.pm:
2166         (GenerateImplementation):
2167         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm:
2168         (-[DOMTestActiveDOMObject finalize]): Deleted.
2169         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
2170         (-[DOMTestCallback finalize]): Deleted.
2171         * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm:
2172         (-[DOMTestCallbackFunction finalize]): Deleted.
2173         * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm:
2174         (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]): Deleted.
2175         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.mm:
2176         (-[DOMTestCustomNamedGetter finalize]): Deleted.
2177         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
2178         (-[DOMTestEventConstructor finalize]): Deleted.
2179         * bindings/scripts/test/ObjC/DOMTestEventTarget.mm:
2180         (-[DOMTestEventTarget finalize]): Deleted.
2181         * bindings/scripts/test/ObjC/DOMTestException.mm:
2182         (-[DOMTestException finalize]): Deleted.
2183         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.mm:
2184         (-[DOMTestGenerateIsReachable finalize]): Deleted.
2185         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
2186         (-[DOMTestInterface finalize]): Deleted.
2187         * bindings/scripts/test/ObjC/DOMTestJSBuiltinConstructor.mm:
2188         (-[DOMTestJSBuiltinConstructor finalize]): Deleted.
2189         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm:
2190         (-[DOMTestMediaQueryListListener finalize]): Deleted.
2191         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.mm:
2192         (-[DOMTestNamedConstructor finalize]): Deleted.
2193         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm:
2194         (-[DOMTestNondeterministic finalize]): Deleted.
2195         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2196         (-[DOMTestObj finalize]): Deleted.
2197         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.mm:
2198         (-[DOMTestOverloadedConstructors finalize]): Deleted.
2199         * bindings/scripts/test/ObjC/DOMTestOverrideBuiltins.mm:
2200         (-[DOMTestOverrideBuiltins finalize]): Deleted.
2201         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
2202         (-[DOMTestSerializedScriptValueInterface finalize]): Deleted.
2203         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm:
2204         (-[DOMTestTypedefs finalize]): Deleted.
2205         * bindings/scripts/test/ObjC/DOMattribute.mm:
2206         (-[DOMattribute finalize]): Deleted.
2207         * bindings/scripts/test/ObjC/DOMreadonly.mm:
2208         (-[DOMreadonly finalize]): Deleted.
2209         * bridge/objc/objc_instance.mm:
2210         (ObjcInstance::virtualBegin):
2211         (allocateAutoReleasePool): Deleted.
2212         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2213         * platform/mac/SharedBufferMac.mm:
2214         (+[WebCoreSharedBufferData initialize]): Deleted.
2215         (-[WebCoreSharedBufferData finalize]): Deleted.
2216         * platform/mac/WebCoreObjCExtras.h:
2217         (WebCoreObjCFinalizeOnMainThread): Deleted.
2218
2219 2015-12-03  Zalan Bujtas  <zalan@apple.com>
2220
2221         Simple line layout: Print out simple line layout statistics for the current page from command line.
2222         https://bugs.webkit.org/show_bug.cgi?id=151806
2223
2224         Reviewed Simon Fraser.
2225
2226         com.apple.WebKit.showSimpleLineLayoutCoverage prints out a coverage summary of the current page,
2227         while com.apple.WebKit.showSimpleLineLayoutReasons lists the non-simple line layout blocks including the reasons why
2228         they are not covered.
2229
2230         No change in functionality.
2231
2232         * rendering/SimpleLineLayout.cpp:
2233         (WebCore::SimpleLineLayout::canUseForText):
2234         (WebCore::SimpleLineLayout::canUseForFontAndText):
2235         (WebCore::SimpleLineLayout::canUseForStyle):
2236         (WebCore::SimpleLineLayout::canUseForWithReason):
2237         (WebCore::SimpleLineLayout::canUseFor):
2238         (WebCore::SimpleLineLayout::printReason):
2239         (WebCore::SimpleLineLayout::printReasons):
2240         (WebCore::SimpleLineLayout::printTextForSubtree):
2241         (WebCore::SimpleLineLayout::textLengthForSubtree):
2242         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
2243         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
2244         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
2245         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
2246
2247 2015-12-03  Jonathan Davis  <jond@apple.com>
2248
2249         Add WebCrypto to status page
2250         https://bugs.webkit.org/show_bug.cgi?id=151760
2251
2252         Reviewed by Timothy Hatcher.
2253
2254         * features.json:
2255
2256 2015-12-03  Keith Rollin  <krollin@apple.com>
2257
2258         [Win] fast/forms/HTMLOptionElement_label03.html failing on win7
2259         https://bugs.webkit.org/show_bug.cgi?id=150909
2260         rdar://problem/23539673
2261
2262         Reviewed by Darin Adler.
2263
2264         When returning text to be displayed, an <option> element will return
2265         the value of a label attribute if it exists, or the text content as a
2266         fallback. The failing test concerned the display of a <select>
2267         element when it contained a sole <option> element that had a label
2268         attribute set to a single space. When displayed, various
2269         platform-specific bits of code will strip off the leading and trailing
2270         whitespace. However, when WebKit would use this text to measure how
2271         wide the <select> popup menu button should be, it would not strip off
2272         spaces, leading to the calculated width being wider than necessary.
2273         The approach taken to fix this is to strip whitespace in the label
2274         attribute before it is returned from the <option> element.
2275
2276         No new tests. fast/forms/HTMLOptionElement_label03.html had been
2277         marked as being expected to fail in TestExpectations; that test now
2278         succeeds.
2279
2280         * html/HTMLOptionElement.cpp:
2281         (WebCore::HTMLOptionElement::label):
2282
2283 2015-12-03  Sam Weinig  <sam@webkit.org>
2284
2285         Try to fix the Windows build.
2286
2287         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2288         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
2289         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2290
2291 2015-12-03  Brady Eidson  <beidson@apple.com>
2292
2293         Modern IDB: storage/indexeddb/cursor-advance.html fails.
2294         https://bugs.webkit.org/show_bug.cgi?id=151731
2295
2296         Reviewed by Alex Christensen.
2297
2298         No new tests (At least one failing test now passes).
2299
2300         * Modules/indexeddb/IDBCursor.h:
2301         * Modules/indexeddb/IDBCursor.idl:
2302         
2303         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2304         (WebCore::IDBClient::IDBCursor::advance): Return a custom exception message for TypeError.
2305         * Modules/indexeddb/client/IDBCursorImpl.h:
2306         
2307         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2308         (WebCore::LegacyCursor::advance):
2309         * Modules/indexeddb/legacy/LegacyCursor.h:
2310         
2311         * bindings/js/JSDOMBinding.cpp:
2312         (WebCore::createDOMException):
2313         (WebCore::setDOMException):
2314         * bindings/js/JSDOMBinding.h:
2315         
2316         * bindings/scripts/IDLAttributes.txt:
2317         
2318         * inspector/InspectorIndexedDBAgent.cpp:
2319
2320 2015-12-03  Brent Fulgham  <bfulgham@apple.com>
2321
2322         Allow JavaScript to iterate over plugins for local files
2323         https://bugs.webkit.org/show_bug.cgi?id=151783
2324         <rdar://problem/23692113>
2325
2326         Reviewed by Alexey Proskuryakov.
2327
2328         Test: http/tests/plugins/plugin-javascript-access.html
2329               plugins/plugin-javascript-access.html
2330
2331         * page/Page.cpp:
2332         (WebCore::Page::showAllPlugins): True if we set the debugging flag to show
2333         all plugins, or if the document's origin is from a local file.
2334         * page/Page.h:
2335
2336 2015-12-03  Jer Noble  <jer.noble@apple.com>
2337
2338         Unreviewed build-fix; missing include.
2339
2340         * html/HTMLVideoElement.cpp:
2341
2342 2015-12-03  Brady Eidson  <beidson@apple.com>
2343
2344         Modern IDB: storage/indexeddb/cursor-skip-deleted.html crashes.
2345         https://bugs.webkit.org/show_bug.cgi?id=151794
2346
2347         Reviewed by Alex Christensen.
2348
2349         STL reverse_iterators are a tricky beast.
2350         
2351         They are implemented in terms of a normal forward iterator (called the "base" iterator),
2352         and they decrement a copy of that iterator when dereferenced.
2353             
2354         So when monitoring deletes from  a std::set to check if we should invalidate our current 
2355         reverse_iterator, we were incorrectly comparing the deleted key to the value pointed by the
2356         reverse_iterator instead of its base iterator.
2357         
2358         Since the iterators in question are bidirectional, anyways, we can just use a single iterator
2359         and either increment or decrement it as needed.
2360         
2361         No new tests (At least one failing (crashing) test now passes).
2362
2363         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2364         (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
2365         (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
2366         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
2367         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
2368         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
2369         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
2370         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2371         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
2372         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
2373         (WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
2374         (WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): Deleted.
2375         (WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): Deleted.
2376         (WebCore::IDBServer::MemoryObjectStoreCursor::hasIterators): Deleted.
2377         (WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): Deleted.
2378         (WebCore::IDBServer::MemoryObjectStoreCursor::clearIterators): Deleted.
2379         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
2380
2381 2015-12-03  Per Arne Vollan  <peavo@outlook.com>
2382
2383         [WinCairo][MediaFoundation] Main thread can block when session is destroyed.
2384         https://bugs.webkit.org/show_bug.cgi?id=151803
2385
2386         Reviewed by Alex Christensen.
2387
2388         Set flag to make sure that the scheduler thread stops when the session ends.
2389
2390         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2391         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
2392         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
2393         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
2394         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2395         (WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopThread):
2396
2397 2015-12-03  Jer Noble  <jer.noble@apple.com>
2398
2399         [iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
2400         https://bugs.webkit.org/show_bug.cgi?id=150906
2401
2402         Reviewed by Simon Fraser.
2403
2404         When restoring the user interface when exiting PiP, we should return to Fullscreen if that
2405         is where fullscreen was initiated from. Additionally, when we "auto-PiP" by backgrounding the
2406         app in Fullscreen mode, we should "auto-un-PiP" when restoring the application to foreground.
2407
2408         Rather than have a separate method to request exiting fullscreen, entering standard fullscreen,
2409         and switching to & from PiP, add a new method setFullscreenMode() which does all three.
2410
2411         * html/HTMLVideoElement.cpp:
2412         (WebCore::presentationModeToFullscreenMode):
2413         (WebCore::HTMLVideoElement::webkitSetPresentationMode):
2414         (WebCore::HTMLVideoElement::setFullscreenMode):
2415         * html/HTMLVideoElement.h:
2416
2417         Add methods to for clients to request a specific fullscreen mode, and to query whether
2418         the page is currently visible.
2419
2420         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2421         (WebVideoFullscreenControllerContext::requestFullscreenMode):
2422         (WebVideoFullscreenControllerContext::isVisible):
2423         (WebVideoFullscreenControllerContext::requestExitFullscreen): Deleted.
2424         * platform/ios/WebVideoFullscreenModel.h:
2425         * platform/ios/WebVideoFullscreenModelVideoElement.h:
2426         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2427         (WebVideoFullscreenModelVideoElement::requestFullscreenMode):
2428         (WebVideoFullscreenModelVideoElement::isVisible):
2429         (WebVideoFullscreenModelVideoElement::requestExitFullscreen): Deleted.
2430
2431         Track whether returning from PiP should enter fullscreen, or whether foregrounding the app
2432         should cause PiP to return to fullscreen.
2433
2434         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2435         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2436         (-[WebAVPlayerLayer layoutSublayers]): Renamed from -setBounds:. -layoutSublayers is called
2437             more consistently than -setBounds:, including when a sublayer is added to the layer.
2438         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): The PiP WebAVPlayerLayer's
2439             modelVideoLayerFrame property may have been modified, so pass it back up to the fullscreen
2440             layer when exiting PiP.
2441         (WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Request fullscreen if we auto-PiPed.
2442         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Only recreate owned objects if they did not already exist.
2443         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): If we are in PiP mode, enter fullscreen by stopping PiP.
2444         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): requestExitFullscreen() -> requestFullscreenMode().
2445         (WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Animate out the fullscreen window, if exiting Fullscreen -> PiP.
2446         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Set m_shouldReturnToFullscreenAfterEnteringForeground if we auto-PiPed.
2447         (WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): requestExitFullscreen() -> requestFullscreenMode().
2448         (WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): If we are returning from PiP -> Fullscreen, do not hide the fullscreen window.
2449         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): If we are returning from PiP -> Fullscreen, show the controls and notify clients.
2450         (WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Animate in the fullscreen window, if returning from PiP -> Fullscreen.
2451         (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Set m_shouldReturnToFullscreenWhenStoppingPiP if we are entering PiP from Fullscreen.
2452         * platform/spi/cocoa/AVKitSPI.h:
2453
2454 2015-12-02  Sam Weinig  <sam@webkit.org>
2455
2456         Promise callbacks should be called at microtask checkpoints
2457         https://bugs.webkit.org/show_bug.cgi?id=147933
2458
2459         Reviewed by Chris Dumez.
2460
2461         - Re-names MicroTaskQueue and MicroTask to MicrotaskQueue and Microtask to match the spec language.
2462         - Re-implements MicrotaskQueue and Microtask support suspended Microtasks (via the new KeepInQueue
2463           result value a Microtask can have when running) and correct behavior when Microtasks are added to
2464           the queue during a Microtask checkpoint.
2465         - MicrotaskQueue now has a mainThreadQueue() static function, replacing the old singleton() function,
2466           which can be used for the Document (non-Worker) Microtasks. For Workers, the a MicrotaskQueue 
2467           can be separately allocated for each WorkerGlobalScope (though this was not done in this change).
2468         - Adds a helper subclass of Microtask, ActiveDOMCallbackMicrotask, for Microtasks that are
2469           per-ScriptExecutationContext, and need to act as ActiveDOMCallbacks.
2470         - Re-implement Document (non-Worker) Promises on top of ActiveDOMCallbackMicrotask.
2471         - Re-implement MutationObserver delivery on top of Microtask.
2472
2473         Layout Test:
2474             fast/dom/microtask-promise-mutation-observer-order.html
2475
2476         * CMakeLists.txt:
2477         * WebCore.vcxproj/WebCore.vcxproj:
2478         * WebCore.xcodeproj/project.pbxproj:
2479         * dom/DOMAllInOne.cpp:
2480         Add new files.
2481
2482         * bindings/js/JSDOMWindowBase.cpp:
2483         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2484         Switch to using ActiveDOMCallbackMicrotask/MicrotaskQueue rather than ScriptExecutionContext's Task mechanism
2485         for JavaScriptCore tasks.
2486
2487         * bindings/js/JSMainThreadExecState.cpp:
2488         (WebCore::JSMainThreadExecState::didLeaveScriptContext):
2489         Perform a microtask checkpoint rather than calling MutationObserver code explicitly now that mutation observers
2490         use microtasks.
2491
2492         * dom/ActiveDOMCallbackMicrotask.cpp: Added.
2493         (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
2494         (WebCore::ActiveDOMCallbackMicrotask::~ActiveDOMCallbackMicrotask):
2495         (WebCore::ActiveDOMCallbackMicrotask::run):
2496         (WebCore::ActiveDOMCallbackMicrotask::contextDestroyed):
2497         * dom/ActiveDOMCallbackMicrotask.h: Added.
2498         Add a helper subclass of Microtask which behaves like a ActiveDOMCallback (e.g. supports suspension
2499         and context destruction).
2500
2501         * dom/MicroTask.cpp: Renamed to Microtasks.cpp.
2502         * dom/MicroTask.h: Renamed to Microtasks.h.
2503         * dom/Microtasks.cpp: Renamed from Source/WebCore/dom/MicroTask.cpp.
2504         (WebCore::Microtask::removeSelfFromQueue):
2505         (WebCore::MicrotaskQueue::mainThreadQueue):
2506         (WebCore::MicrotaskQueue::append):
2507         (WebCore::MicrotaskQueue::remove):
2508         (WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
2509         (WebCore::MicroTaskQueue::singleton): Deleted.
2510         (WebCore::MicroTaskQueue::queueMicroTask): Deleted.
2511         (WebCore::MicroTaskQueue::runMicroTasks): Deleted.
2512         * dom/Microtasks.h: Renamed from Source/WebCore/dom/MicroTask.h.
2513         (WebCore::Microtask::~Microtask):
2514         (WebCore::MicrotaskQueue::MicrotaskQueue):
2515         (WebCore::MicrotaskQueue::~MicrotaskQueue):
2516         (WebCore::MicroTask::~MicroTask): Deleted.
2517         (WebCore::MicroTaskQueue::~MicroTaskQueue): Deleted.
2518         (WebCore::MicroTaskQueue::MicroTaskQueue): Deleted.
2519         Re-implement MicrotaskQueue and Microtask to support Microtask suspension (via the KeepInQueue result
2520         value) and correct behavior when Microtasks are queued during checkpoints.
2521
2522         * dom/MutationObserver.cpp:
2523         (WebCore::suspendedMutationObservers):
2524         (WebCore::MutationObserverMicrotask::MutationObserverMicrotask):
2525         (WebCore::MutationObserverMicrotask::~MutationObserverMicrotask):
2526         (WebCore::MutationObserverMicrotask::run):
2527         (WebCore::queueMutationObserverCompoundMicrotask):
2528         (WebCore::MutationObserver::enqueueMutationRecord):
2529         (WebCore::MutationObserver::setHasTransientRegistration):
2530         * dom/MutationObserver.h:
2531         Re-implement MutationObserver delivery on top of Microtasks.
2532
2533         * dom/ScriptRunner.cpp:
2534         (WebCore::ScriptRunner::timerFired):
2535         Remove unnecessary call to runMicroTasks().
2536
2537         * html/parser/HTMLScriptRunner.cpp:
2538         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2539         (WebCore::HTMLScriptRunner::runScript):
2540         Remove calls to MutationObserver::deliverAllMutations() now that the MicrotaskQueue will take care of it.
2541
2542         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
2543         Remove unnecessary call to runMicroTasks().
2544
2545         * testing/Internals.cpp:
2546         (WebCore::Internals::queueMicroTask):
2547         Use ActiveDOMCallbackMicrotask rather than a custom test subclass.
2548
2549         * testing/MicroTaskTest.cpp: Removed.
2550         * testing/MicroTaskTest.h: Removed.
2551         Remove custom test subclass of Microtask, just use ActiveDOMCallbackMicrotask directly.
2552
2553 2015-12-03  Brady Eidson  <beidson@apple.com>
2554
2555         Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
2556         https://bugs.webkit.org/show_bug.cgi?id=151807
2557
2558         Reviewed by Alex Christensen.
2559
2560         No new tests (Covered by changes to existing bindings tests).
2561
2562         While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
2563         two separate variables to reduce complexity.
2564         
2565         * bindings/scripts/CodeGeneratorJS.pm:
2566         (GenerateImplementation):
2567         (GenerateImplementationFunctionCall):
2568         (GenerateConstructorDefinition):
2569         (GenerateParametersCheck): Deleted.
2570         (GenerateReturnParameters): Deleted.
2571         
2572         * bindings/scripts/IDLAttributes.txt:
2573         
2574         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2575         (webkit_dom_test_obj_set_property):
2576         (webkit_dom_test_obj_get_property):
2577         (webkit_dom_test_obj_class_init):
2578         (webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
2579         (webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
2580         (webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
2581         (webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
2582         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2583         
2584         * bindings/scripts/test/JS/JSTestObj.cpp:
2585         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
2586         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
2587         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
2588         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
2589         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
2590         * bindings/scripts/test/ObjC/DOMTestObj.h:
2591         
2592         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2593         (-[DOMTestObj attrWithGetterExceptionWithMessage]):
2594         (-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
2595         (-[DOMTestObj attrWithSetterExceptionWithMessage]):
2596         (-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
2597         
2598         * bindings/scripts/test/TestObj.idl:
2599         
2600         * dom/ExceptionCode.h:
2601
2602 2015-12-03  Javier Fernandez  <jfernandez@igalia.com>
2603
2604         [css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
2605         https://bugs.webkit.org/show_bug.cgi?id=151802
2606
2607         Reviewed by Sergio Villar Senin.
2608
2609         When resolving auto margins so that they use the available space, in the
2610         corresponding axis, we must consider that there might be other specified
2611         margins. Such margins must account to determine the actual available space.
2612
2613         Test: fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html
2614
2615         * rendering/RenderGrid.cpp:
2616         (WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
2617         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
2618
2619 2015-12-02  Antti Koivisto  <antti@apple.com>
2620
2621         Move ResourceLoadScheduler to WebKit1
2622         https://bugs.webkit.org/show_bug.cgi?id=151743
2623
2624         Reviewed by Alex Christensen.
2625
2626         It is no longer used by WebKit2. Simplify the WebKit/WebCore interface.
2627
2628         * WebCore.xcodeproj/project.pbxproj:
2629         * dom/ContainerNode.cpp:
2630         * dom/Document.cpp:
2631         (WebCore::Document::styleForElementIgnoringPendingStylesheets):
2632         * dom/Document.h:
2633         * loader/DocumentLoader.h:
2634         * loader/LoaderStrategy.cpp:
2635         (WebCore::LoaderStrategy::~LoaderStrategy):
2636         (WebCore::ResourceLoadSuspender::ResourceLoadSuspender):
2637         (WebCore::ResourceLoadSuspender::~ResourceLoadSuspender):
2638         (WebCore::LoaderStrategy::resourceLoadScheduler): Deleted.
2639         (WebCore::LoaderStrategy::loadResourceSynchronously): Deleted.
2640         (WebCore::LoaderStrategy::createBlobRegistry): Deleted.
2641         (WebCore::LoaderStrategy::createPingHandle): Deleted.
2642         * loader/LoaderStrategy.h:
2643
2644             Loading functions implemented on WebKit side move to pure virtual LoaderStrategy.
2645
2646         * loader/ResourceLoadScheduler.cpp: Removed.
2647         * loader/ResourceLoadScheduler.h: Removed.
2648
2649             ResourceLoadScheduler moves to WebKit1 as WebResourceLoadScheduler.
2650
2651         * loader/ResourceLoader.cpp:
2652         (WebCore::ResourceLoader::finishNetworkLoad):
2653         (WebCore::ResourceLoader::setDefersLoading):
2654         (WebCore::ResourceLoader::frameLoader):
2655         (WebCore::ResourceLoader::willSwitchToSubstituteResource):
2656         (WebCore::ResourceLoader::willSendRequestInternal):
2657         * loader/archive/ArchiveResourceCollection.h:
2658         * loader/cache/CachedResource.cpp:
2659         (WebCore::CachedResource::load):
2660         * loader/cache/CachedResourceLoader.cpp:
2661         (WebCore::CachedResourceLoader::performPostLoadActions):
2662         (WebCore::CachedResourceLoader::incrementRequestCount):
2663         * platform/PlatformStrategies.h:
2664         (WebCore::PlatformStrategies::pluginStrategy):
2665         (WebCore::PlatformStrategies::blobRegistry):
2666
2667             Move BlobRegistry factory function here from LoaderStrategy as this allows network process to have null loaderStrategy.
2668             (it could be renamed BlobStrategy for consistency later).
2669
2670         (WebCore::PlatformStrategies::PlatformStrategies):
2671         * platform/network/BlobRegistry.cpp:
2672         (WebCore::blobRegistry):
2673         (WebCore::BlobRegistry::~BlobRegistry):
2674         * platform/network/ResourceRequestBase.h:
2675         * style/StyleResolveTree.cpp:
2676         (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
2677         (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):
2678
2679 2015-12-02  Myles C. Maxfield  <mmaxfield@apple.com>
2680
2681         Unify font-variant-* with font-variant shorthand
2682         https://bugs.webkit.org/show_bug.cgi?id=149773
2683
2684         Reviewed by Darin Adler.
2685
2686         This patch makes font-variant a shorthand for the following properties:
2687         font-variant-ligatures
2688         font-variant-position
2689         font-variant-caps
2690         font-variant-numeric
2691         font-variant-alternates
2692         font-variant-east-asian
2693
2694         This is consistent with the CSS Fonts Level 3 spec.
2695
2696         This patch also migrates the "font" longhand to use the font-variant-caps
2697         property.
2698
2699         Test: fast/text/font-variant-shorthand.html
2700
2701         * css/CSSComputedStyleDeclaration.cpp:
2702         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
2703         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
2704         font-variant computed style.
2705         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
2706         the font shorthand.
2707         * css/CSSFontSelector.cpp:
2708         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
2709         of the new shorthand property).
2710         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
2711         (WebCore::CSSParser::parseValue):
2712         (WebCore::CSSParser::parseFont):
2713         (WebCore::CSSParser::parseSystemFont):
2714         (WebCore::CSSParser::parseFontVariantLigatures):
2715         (WebCore::CSSParser::parseFontVariantNumeric):
2716         (WebCore::CSSParser::parseFontVariantEastAsian):
2717         (WebCore::CSSParser::parseFontVariant):
2718         (WebCore::isValidKeywordPropertyAndValue): Deleted.
2719         (WebCore::isKeywordPropertyID): Deleted.
2720         * css/CSSParser.h:
2721         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
2722         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
2723         FontVariantEastAsian type.
2724         (WebCore::applyValueFontVariantLigatures):
2725         (WebCore::applyValueFontVariantNumeric):
2726         (WebCore::applyValueFontVariantEastAsian):
2727         * css/StyleProperties.cpp: Update to use the more specific property.
2728         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
2729         (WebCore::StyleProperties::fontValue):
2730         (WebCore::StyleProperties::asText):
2731         * css/StyleResolver.cpp: Ditto.
2732         (WebCore::StyleResolver::isValidCueStyleProperty):
2733         * editing/EditingStyle.cpp: Ditto.
2734         * editing/cocoa/HTMLConverter.mm: Ditto.
2735         (HTMLConverterCaches::propertyValueForNode):
2736         (HTMLConverter::computedAttributesForElement):
2737         * editing/ios/EditorIOS.mm: Ditto.
2738         (WebCore::Editor::removeUnchangeableStyles):
2739         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
2740         (WebCore::CanvasRenderingContext2D::font):
2741         (WebCore::CanvasRenderingContext2D::setFont):
2742         * platform/graphics/FontCache.h: Removing duplicate cache key value.
2743         (WebCore::FontDescriptionKey::makeFlagsKey):
2744         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
2745         (WebCore::FontCascade::glyphDataForCharacter):
2746         * platform/graphics/FontCascade.h: Ditto.
2747         (WebCore::FontCascade::isSmallCaps):
2748         * platform/graphics/FontDescription.cpp: Ditto.
2749         (WebCore::FontDescription::FontDescription):
2750         * platform/graphics/FontDescription.h: Ditto.
2751         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
2752         (WebCore::FontDescription::smallCaps): Deleted.
2753         (WebCore::FontDescription::setSmallCaps): Deleted.
2754         (WebCore::FontDescription::setIsSmallCaps): Deleted.
2755         (WebCore::FontDescription::operator==): Deleted.
2756         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
2757         (WebCore::computeFeatureSettingsFromVariants):
2758         * platform/text/TextFlags.h: Ditto.
2759         (WebCore::FontVariantSettings::operator==):
2760         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
2761         (WebCore::RenderText::widthFromCache):
2762
2763 2015-12-02  Alex Christensen  <achristensen@webkit.org>
2764
2765         Reduce size of ScriptElement
2766         https://bugs.webkit.org/show_bug.cgi?id=151786
2767
2768         Reviewed by Andreas Kling.
2769
2770         * dom/ScriptElement.cpp:
2771         (WebCore::ScriptElement::ScriptElement):
2772         (WebCore::ScriptElement::requestScript):
2773         * dom/ScriptElement.h:
2774         Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used.
2775         Use bit fields for the boolean values to save another 8 bytes per ScriptElement.
2776         This reduces sizeof(ScriptElement) from 168 to 48 bytes.
2777
2778 2015-12-02  Alex Christensen  <achristensen@webkit.org>
2779
2780         Asynchronously call onerror when a content blocker blocks ascript element's load
2781         https://bugs.webkit.org/show_bug.cgi?id=151649
2782
2783         Reviewed by Brady Eidson.
2784
2785         Test: http/tests/contentextensions/script-onerror.html
2786
2787         * dom/ScriptElement.cpp:
2788         (WebCore::ScriptElement::ScriptElement):
2789         (WebCore::ScriptElement::requestScript):
2790         * dom/ScriptElement.h:
2791
2792 2015-12-02  Jer Noble  <jer.noble@apple.com>
2793
2794         [iOS] Abrupt transition between Fullscreen -> PiP
2795         https://bugs.webkit.org/show_bug.cgi?id=151719
2796
2797         Reviewed by Eric Carlson.
2798
2799         Follow-up to r192922: When moving from inline -> PiP, don't forget to hide the fullscreen
2800         window once the PiP transition completes.
2801
2802         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2803         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
2804
2805 2015-12-02  Commit Queue  <commit-queue@webkit.org>
2806
2807         Unreviewed, rolling out r192955.
2808         https://bugs.webkit.org/show_bug.cgi?id=151776
2809
2810         A large number of the tests added with this change are failing
2811         on Windows (Requested by ryanhaddad on #webkit).
2812
2813         Reverted changeset:
2814
2815         "[css border] border-image doesn't honor border-style"
2816         https://bugs.webkit.org/show_bug.cgi?id=99922
2817         http://trac.webkit.org/changeset/192955
2818
2819 2015-12-02  Yoav Weiss  <yoav@yoav.ws>
2820
2821         Fix preloader issue with srcdoc documents.
2822         https://bugs.webkit.org/show_bug.cgi?id=151744
2823
2824         Reviewed by Ryosuke Niwa.
2825
2826         Make sure that PreloadRequest is resolving URLs based on the document's
2827         baseURL() rather than using url() as the base URL, which is not how URLs
2828         are resolved by the parser, and fails when document->url() diverges from
2829         the document's base URL (e.g. in the case of srcdoc based documents).
2830
2831         Test: fast/preloader/iframe-srcdoc.html
2832
2833         * html/parser/HTMLResourcePreloader.cpp:
2834         (WebCore::PreloadRequest::completeURL):
2835
2836 2015-12-02  Jer Noble  <jer.noble@apple.com>
2837
2838         Add a setting and restriction which will pause invisible autoplaying video
2839         https://bugs.webkit.org/show_bug.cgi?id=151412
2840
2841         Reviewed by Eric Carlson.
2842
2843         Test: media/video-restricted-invisible-autoplay-not-allowed.html
2844
2845         Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
2846         calls did not originate from an explicit request to pause or play, e.g., during an interruption.
2847         This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
2848         interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
2849         restore it when an interruption ends.
2850
2851         Add a means to register for viewport visibility notifications to FrameView, RenderView,
2852         and RenderElement. Elements who wish to recieve these notifications must do so through their
2853         renderer, and thus will have to re-register whenever a new renderer is attached.
2854
2855         Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
2856         out of the viewport, or is hidden with CSS.
2857
2858         Add a setting which controls whether that new restriction is set.
2859
2860         * dom/Element.h:
2861         (WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
2862         * html/HTMLMediaElement.cpp:
2863         (WebCore::HTMLMediaElement::HTMLMediaElement):
2864         (WebCore::HTMLMediaElement::didMoveToNewDocument):
2865         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
2866         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
2867         (WebCore::HTMLMediaElement::resumeAutoplaying):
2868         (WebCore::mediaElementIsAllowedToAutoplay):
2869         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
2870         (WebCore::HTMLMediaElement::updateShouldAutoplay):
2871         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
2872         (WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
2873         (WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
2874         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
2875         (WebCore::HTMLMediaElement::removedFrom): Ditto.
2876         (WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
2877         (WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
2878         (WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
2879         (WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
2880         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
2881         (WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
2882         (WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
2883         (WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
2884         * html/HTMLMediaElement.h:
2885         * html/MediaElementSession.cpp:
2886         (WebCore::restrictionName): Added support for new restriction.
2887         * html/MediaElementSession.h:
2888         * page/FrameView.cpp:
2889         (WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
2890         * page/Settings.in:
2891         * platform/audio/PlatformMediaSession.cpp:
2892         (WebCore::stateName): Add new "Autoplay" state.
2893         (WebCore::interruptionName): Added new interruption type.
2894         (WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
2895         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
2896         * platform/audio/PlatformMediaSession.h:
2897         (WebCore::PlatformMediaSession::interruptionType): Added getter.
2898         (WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
2899         * platform/audio/PlatformMediaSessionManager.cpp:
2900         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
2901         * rendering/RenderElement.cpp:
2902         (WebCore::RenderElement::RenderElement): Set new ivars.
2903         (WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
2904         (WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
2905         (WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
2906         (WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
2907         * rendering/RenderElement.h:
2908         * rendering/RenderView.cpp:
2909         (WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
2910         (WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
2911         (WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
2912         * rendering/RenderView.h:
2913         * testing/Internals.cpp:
2914         (WebCore::Internals::setMediaElementRestrictions): Support new restriction.
2915
2916 2015-12-02  Brady Eidson  <beidson@apple.com>
2917
2918         Modern IDB: IDBTransaction::error is not exposed.
2919         https://bugs.webkit.org/show_bug.cgi?id=151752
2920
2921         Reviewed by Alex Christensen.
2922
2923         No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
2924
2925         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2926         (WebCore::IDBClient::IDBRequest::dispatchEvent):
2927         (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
2928         * Modules/indexeddb/client/IDBRequestImpl.h:
2929         
2930         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2931         (WebCore::IDBClient::IDBTransaction::error):
2932         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
2933         (WebCore::IDBClient::IDBTransaction::abort):
2934         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
2935         * Modules/indexeddb/client/IDBTransactionImpl.h:
2936
2937 2015-12-02  Adenilson Cavalcanti  <cavalcantii@gmail.com>
2938
2939         [css border] border-image doesn't honor border-style
2940         https://bugs.webkit.org/show_bug.cgi?id=99922
2941
2942         Reviewed by Simon Fraser.
2943
2944         Ensure that WebKit will be compliant to css-backgrounds spec where a
2945         border with an image will only be rendered if there is a style defined.
2946
2947         Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
2948         Reference: http://www.w3.org/TR/css3-background/#border-style
2949
2950         From W3C discussion: "The fact that these properties set the style of the border is
2951         normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html
2952
2953         Test: fast/borders/border-image-should-not-display.html
2954
2955         * rendering/style/BorderData.h:
2956         (WebCore::BorderData::hasBorder):
2957         (WebCore::BorderData::borderLeftWidth):
2958         (WebCore::BorderData::borderRightWidth):
2959         (WebCore::BorderData::borderTopWidth):
2960         (WebCore::BorderData::borderBottomWidth):
2961         * rendering/style/BorderValue.h:
2962         (WebCore::BorderValue::nonZero):
2963         (WebCore::BorderValue::isVisible):
2964
2965 2015-12-02  Eric Carlson  <eric.carlson@apple.com>
2966
2967         [MediaStream] Implement MediaStreamTrack.getSettings()
2968         https://bugs.webkit.org/show_bug.cgi?id=151727
2969
2970         Reviewed by Jer Noble.
2971
2972         MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings. 
2973
2974         Test: fast/mediastream/MediaStreamTrack-getSettings.html
2975
2976         * CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
2977         * DerivedSources.make: No more MediaSourceStates.idl.
2978         * Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
2979         * Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
2980         (WebCore::MediaSourceSettings::create):
2981         (WebCore::MediaSourceSettings::MediaSourceSettings):
2982         (WebCore::MediaSourceSettings::facingMode):
2983         (WebCore::MediaSourceStates::create): Deleted.
2984         (WebCore::MediaSourceStates::MediaSourceStates): Deleted.
2985         (WebCore::MediaSourceStates::sourceType): Deleted.
2986         (WebCore::MediaSourceStates::facingMode): Deleted.
2987         * Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.
2988
2989         MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
2990         * Modules/mediastream/MediaSourceStates.cpp: Removed.
2991         * Modules/mediastream/MediaSourceStates.h: Removed.
2992         * Modules/mediastream/MediaSourceStates.idl: Removed.
2993
2994         * Modules/mediastream/MediaStreamCapabilities.cpp:
2995         (WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
2996           by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
2997         (WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
2998         (WebCore::MediaStreamCapabilities::facingMode): Ditto.
2999
3000         * Modules/mediastream/MediaStreamTrack.cpp:
3001         (WebCore::MediaStreamTrack::getSettings): New.
3002         (WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
3003           private track returns.
3004         (WebCore::MediaStreamTrack::trackSettingsChanged):
3005         (WebCore::MediaStreamTrack::states): Deleted.
3006         (WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
3007         * Modules/mediastream/MediaStreamTrack.h:
3008         * Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.
3009
3010         * Modules/webaudio/MediaStreamAudioSource.cpp:
3011         (WebCore::MediaStreamAudioSource::settings):
3012         (WebCore::MediaStreamAudioSource::states): Deleted.
3013         * Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.
3014
3015         * WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.
3016
3017         * bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
3018         * bindings/js/JSMediaStreamTrackCustom.cpp: Added.
3019         (WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so 
3020           it has to be generated manually.
3021
3022         * platform/mediastream/MediaStreamPrivate.cpp:
3023         (WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
3024         (WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
3025         * platform/mediastream/MediaStreamPrivate.h:
3026
3027         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3028         (WebCore::MediaStreamTrackPrivate::settings):
3029         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
3030         (WebCore::MediaStreamTrackPrivate::states): Deleted.
3031         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
3032         * platform/mediastream/MediaStreamTrackPrivate.h:
3033
3034         * platform/mediastream/RealtimeMediaSource.cpp:
3035         (WebCore::RealtimeMediaSource::settingsDidChanged):
3036         (WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
3037         * platform/mediastream/RealtimeMediaSource.h:
3038
3039         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
3040         (WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
3041         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
3042         (WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
3043         (WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
3044         (WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.
3045
3046         * platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
3047         * platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
3048         (WebCore::RealtimeMediaSourceSettings::facingMode):
3049         (WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
3050         (WebCore::RealtimeMediaSourceStates::sourceType): Deleted.
3051
3052         * platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
3053         * platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.
3054
3055         * platform/mediastream/RealtimeMediaSourceStates.h: Removed.
3056         * platform/mediastream/mac/AVAudioCaptureSource.h:
3057         * platform/mediastream/mac/AVAudioCaptureSource.mm:
3058         (WebCore::AVAudioCaptureSource::updateStates): Deleted.
3059
3060         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3061         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3062
3063         * platform/mediastream/mac/AVMediaCaptureSource.h:
3064         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3065         (WebCore::AVMediaCaptureSource::states): Deleted.
3066
3067         * platform/mediastream/mac/AVVideoCaptureSource.h:
3068         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3069         (WebCore::AVVideoCaptureSource::updateStates): Deleted.
3070
3071         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3072
3073         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
3074
3075         * platform/mock/MockRealtimeAudioSource.cpp:
3076         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
3077         (WebCore::MockRealtimeAudioSource::updateStates): Deleted.
3078         * platform/mock/MockRealtimeAudioSource.h:
3079
3080         * platform/mock/MockRealtimeMediaSource.cpp:
3081         (WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
3082         (WebCore::MockRealtimeMediaSource::settings):
3083         (WebCore::MockRealtimeMediaSource::supportedConstraints):
3084         (WebCore::MockRealtimeMediaSource::states): Deleted.
3085         * platform/mock/MockRealtimeMediaSource.h:
3086         (WebCore::MockRealtimeMediaSource::constraints):
3087         (WebCore::MockRealtimeMediaSource::currentStates): Deleted.
3088
3089         * platform/mock/MockRealtimeVideoSource.cpp:
3090         (WebCore::MockRealtimeVideoSource::updateSettings):
3091         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
3092         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
3093         (WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
3094         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
3095         (WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
3096         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
3097         (WebCore::MockRealtimeVideoSource::updateStates): Deleted.
3098         (WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
3099         * platform/mock/MockRealtimeVideoSource.h:
3100
3101 2015-11-30  David Hyatt  <hyatt@apple.com>
3102
3103         Implement the picture element.
3104         https://bugs.webkit.org/show_bug.cgi?id=116963
3105
3106         Reviewed by Dean Jackson.
3107
3108         Added fast/picture tests.
3109
3110         * WebCore.xcodeproj/project.pbxproj:
3111         Add HTMLPictureElement.* to the project.
3112
3113         * html/HTMLImageElement.cpp:
3114         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
3115         Remove the CURRENT_SRC ifdef.
3116
3117         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3118         New helper function that checks the <source> elements of a <picture> parent
3119         for the best match.
3120
3121         (WebCore::HTMLImageElement::selectImageSource):
3122         Pull out the process of image selection into its own function so that this can
3123         be called from many places (to ensure that dynamic changes are reflected as elements
3124         get changed, added or removed).
3125
3126         (WebCore::HTMLImageElement::parseAttribute):
3127         Call selectImageSource when attributes change.
3128
3129         (WebCore::HTMLImageElement::insertedInto):
3130         If inserted into a picture element, make sure to update the source.
3131
3132         * html/HTMLImageElement.h:
3133         (WebCore::HTMLImageElement::currentSrc):
3134         Remove the CURRENT_SRC ifdef.
3135
3136         * html/HTMLImageElement.idl:
3137         Remove the CURRENT_SRC ifdef.
3138
3139         * html/HTMLPictureElement.cpp: Added.
3140         (WebCore::HTMLPictureElement::HTMLPictureElement):
3141         (WebCore::HTMLPictureElement::create):
3142         (WebCore::HTMLPictureElement::sourcesChanged):
3143         * html/HTMLPictureElement.h: Added.
3144         The new picture element. Has a sourcesChanged() function that is invoked whenever anything
3145         about the <source> elements changes.
3146
3147         * html/HTMLSourceElement.cpp:
3148         (WebCore::HTMLSourceElement::insertedInto):
3149         (WebCore::HTMLSourceElement::removedFrom):
3150         (WebCore::HTMLSourceElement::parseAttribute):
3151         Make sure to call sourcesChanged when new sources come and go or when attributes on
3152         source elements change.
3153
3154         * html/HTMLSourceElement.h:
3155         Added parseAttribute function so we can see when attributes change that force us to
3156         do a dynamic update.
3157
3158         * html/HTMLTagNames.in:
3159         Add the picture element.
3160
3161         * html/parser/HTMLSrcsetParser.h:
3162         (WebCore::ImageCandidate::srcOrigin):
3163         (WebCore::ImageCandidate::isEmpty):
3164         Some helpers for picture parsing.
3165
3166 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
3167
3168         [WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
3169         https://bugs.webkit.org/show_bug.cgi?id=151757
3170
3171         Reviewed by Alex Christensen.
3172
3173         We need to make sure we use the same bitmap format as in the Direct3D surface
3174         in video memory when copying surface data and rendering with Cairo.
3175
3176         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3177         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
3178         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
3179
3180 2015-12-02  Brady Eidson  <beidson@apple.com>
3181
3182         Modern IDB: Get rid of IDBExceptionCode.
3183         https://bugs.webkit.org/show_bug.cgi?id=151753
3184
3185         Reviewed by Alex Christensen.
3186
3187         No new tests (No change in behavior).
3188
3189         * Modules/indexeddb/client/IDBIndexImpl.cpp:
3190         (WebCore::IDBClient::IDBIndex::count):
3191         (WebCore::IDBClient::IDBIndex::doCount):
3192         (WebCore::IDBClient::IDBIndex::get):
3193         (WebCore::IDBClient::IDBIndex::doGet):
3194         (WebCore::IDBClient::IDBIndex::getKey):
3195         (WebCore::IDBClient::IDBIndex::doGetKey):
3196         
3197         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3198         (WebCore::IDBClient::IDBObjectStore::get):
3199         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
3200         (WebCore::IDBClient::IDBObjectStore::clear):
3201         (WebCore::IDBClient::IDBObjectStore::createIndex):
3202         (WebCore::IDBClient::IDBObjectStore::index):
3203         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
3204         (WebCore::IDBClient::IDBObjectStore::count):
3205         (WebCore::IDBClient::IDBObjectStore::doCount):
3206         
3207         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3208         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
3209         
3210         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3211         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
3212         
3213         * Modules/indexeddb/server/IndexValueStore.cpp:
3214         (WebCore::IDBServer::IndexValueStore::addRecord):
3215         
3216         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3217         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
3218         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
3219         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
3220         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
3221         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
3222         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
3223         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
3224         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
3225         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
3226         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
3227         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3228         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
3229         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
3230         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
3231         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
3232         
3233         * Modules/indexeddb/server/MemoryIndex.cpp:
3234         (WebCore::IDBServer::MemoryIndex::putIndexKey):
3235         
3236         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3237         (WebCore::IDBServer::MemoryObjectStore::createIndex):
3238         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
3239         
3240         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3241         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
3242         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
3243         
3244         * Modules/indexeddb/shared/IDBError.cpp:
3245         (WebCore::IDBError::IDBError):
3246         (WebCore::IDBError::name):
3247         (WebCore::IDBError::message):
3248         (WebCore::idbErrorName): Deleted.
3249         (WebCore::idbErrorDescription): Deleted.
3250         
3251         * Modules/indexeddb/shared/IDBError.h:
3252         (WebCore::IDBError::code):
3253         (WebCore::IDBError::isNull):
3254
3255 2015-12-02  Jiewen Tan  <jiewen_tan@apple.com>
3256
3257         Null dereference loading Blink layout test fast/loader/unload-mutation-crash.html
3258         https://bugs.webkit.org/show_bug.cgi?id=149305
3259         <rdar://problem/22747892>
3260
3261         Reviewed by Brent Fulgham.
3262
3263         Add an extra guard to replaceDocument() against rude JS in unload event handlers.
3264
3265         Test: fast/loader/unload-mutation-crash.html
3266
3267         * loader/DocumentWriter.cpp:
3268         (WebCore::DocumentWriter::replaceDocument):
3269         (WebCore::DocumentWriter::begin):
3270
3271 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
3272
3273         [WinCairo] Compile error.
3274         https://bugs.webkit.org/show_bug.cgi?id=151742
3275
3276         Reviewed by Csaba Osztrogonác.
3277
3278         System font flag has moved from Font class to FontData class.
3279
3280         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
3281         (WebCore::Font::platformInit):
3282
3283 2015-12-01  Commit Queue  <commit-queue@webkit.org>
3284
3285         Unreviewed, rolling out r192894 and r192904.
3286         https://bugs.webkit.org/show_bug.cgi?id=151738
3287
3288         Crashes sometimes on Windows (Requested by litherum on
3289         #webkit).
3290
3291         Reverted changesets:
3292
3293         "[Win] Web fonts with small caps have excess whitespace with
3294         the complex text codepath"
3295         https://bugs.webkit.org/show_bug.cgi?id=151698
3296         http://trac.webkit.org/changeset/192894
3297
3298         "Test gardening after r192894"
3299         http://trac.webkit.org/changeset/192904
3300
3301 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3302
3303         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
3304         https://bugs.webkit.org/show_bug.cgi?id=150792
3305
3306         Reviewed by Saam Barati.
3307
3308         * Configurations/FeatureDefines.xcconfig:
3309
3310 2015-12-01  Commit Queue  <commit-queue@webkit.org>
3311
3312         Unreviewed, rolling out r192914.
3313         https://bugs.webkit.org/show_bug.cgi?id=151734
3314
3315         JSC tests for this change are failing on 32 and 64-bit bots
3316         (Requested by ryanhaddad on #webkit).
3317
3318         Reverted changeset:
3319
3320         "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
3321         enable this feature"
3322         https://bugs.webkit.org/show_bug.cgi?id=150792
3323         http://trac.webkit.org/changeset/192914
3324
3325 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
3326
3327         [SVG -> OTF Converter] Force UnitsPerEm to 1000
3328         https://bugs.webkit.org/show_bug.cgi?id=151650
3329
3330         Reviewed by Antti Koivisto.
3331
3332         According to the Adobe Type 1 Font Format:
3333
3334         "Type 1 font programs generally use a 1000 to 1 scaling matrix
3335         for the definition of the relationship of character space unites
3336         to user space units."
3337
3338         Windows actually disregards the "unitsPerEm" value in the "head"
3339         table for some calculations, and hardcodes 1000 instead. In order
3340         to have consistent renderings on Windows and OS X, this patch
3341         forces all generated fonts to have a unitsPerEm of 1000, and
3342         appropriately scales all necessary values.
3343
3344         Test: svg/W3C-SVG-1.1/fonts-elem-03-b.svg
3345
3346         * svg/SVGToOTFFontConversion.cpp:
3347         (WebCore::SVGToOTFFontConverter::scaleUnitsPerEm):
3348         (WebCore::SVGToOTFFontConverter::appendHEADTable):
3349         (WebCore::SVGToOTFFontConverter::appendOS2Table):
3350         (WebCore::SVGToOTFFontConverter::appendVORGTable):
3351         (WebCore::SVGToOTFFontConverter::appendVHEATable):
3352         (WebCore::SVGToOTFFontConverter::appendVMTXTable):
3353         (WebCore::SVGToOTFFontConverter::addKerningPair):
3354         (WebCore::CFFBuilder::CFFBuilder):
3355         (WebCore::CFFBuilder::boundingBox):
3356         (WebCore::CFFBuilder::updateBoundingBox):
3357         (WebCore::CFFBuilder::unscaledLineTo):
3358         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
3359         (WebCore::SVGToOTFFontConverter::processGlyphElement):
3360         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
3361         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
3362
3363 2015-12-01  Brady Eidson  <beidson@apple.com>
3364
3365         Give a more detailed message for TypeErrors that result from EnforceRange.
3366         https://bugs.webkit.org/show_bug.cgi?id=151725
3367
3368         Reviewed by Tim Horton.
3369
3370         No new tests (Covered by changes to existing tests).
3371
3372         * bindings/js/JSDOMBinding.cpp:
3373         (WebCore::rangeErrorString):
3374         (WebCore::enforceRange):
3375
3376 2015-12-01  Jer Noble  <jer.noble@apple.com>
3377
3378         [iOS] Abrupt transition between Fullscreen -> PiP
3379         https://bugs.webkit.org/show_bug.cgi?id=151719
3380
3381         Reviewed by Eric Carlson.
3382
3383         Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.
3384
3385         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3386         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
3387
3388 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
3389
3390         Give String and AtomicString an existingHash() function
3391         https://bugs.webkit.org/show_bug.cgi?id=151717
3392
3393         Reviewed by Andreas Kling.
3394
3395         No new tests because there is no behavior change.
3396
3397         * platform/graphics/Font.cpp:
3398         (WebCore::CharacterFallbackMapKeyHash::hash):
3399
3400 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
3401
3402         [Win] Build fix after r192895
3403
3404         Unreviewed.
3405
3406         * platform/graphics/FontPlatformData.h:
3407         (WebCore::FontPlatformData::isSystemFont):
3408         (WebCore::FontPlatformData::setIsSystemFont):
3409         * platform/graphics/win/SimpleFontDataCGWin.cpp:
3410         (WebCore::Font::platformInit):
3411         (WebCore::Font::platformWidthForGlyph):
3412
3413 2015-12-01  Alexey Proskuryakov  <ap@apple.com>
3414
3415         Update bindings test results after r192903.
3416
3417         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3418         (WebCore::JSTestEventConstructorConstructor::construct):
3419