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