d58596f6a2ad1fd355c1ec04315c0116843f5d57
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-02  Jer Noble  <jer.noble@apple.com>
2
3         Add a setting and restriction which will pause invisible autoplaying video
4         https://bugs.webkit.org/show_bug.cgi?id=151412
5
6         Reviewed by Eric Carlson.
7
8         Test: media/video-restricted-invisible-autoplay-not-allowed.html
9
10         Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
11         calls did not originate from an explicit request to pause or play, e.g., during an interruption.
12         This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
13         interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
14         restore it when an interruption ends.
15
16         Add a means to register for viewport visibility notifications to FrameView, RenderView,
17         and RenderElement. Elements who wish to recieve these notifications must do so through their
18         renderer, and thus will have to re-register whenever a new renderer is attached.
19
20         Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
21         out of the viewport, or is hidden with CSS.
22
23         Add a setting which controls whether that new restriction is set.
24
25         * dom/Element.h:
26         (WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
27         * html/HTMLMediaElement.cpp:
28         (WebCore::HTMLMediaElement::HTMLMediaElement):
29         (WebCore::HTMLMediaElement::didMoveToNewDocument):
30         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
31         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
32         (WebCore::HTMLMediaElement::resumeAutoplaying):
33         (WebCore::mediaElementIsAllowedToAutoplay):
34         (WebCore::HTMLMediaElement::isVisibleInViewportChanged):
35         (WebCore::HTMLMediaElement::updateShouldAutoplay):
36         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
37         (WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
38         (WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
39         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
40         (WebCore::HTMLMediaElement::removedFrom): Ditto.
41         (WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
42         (WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
43         (WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
44         (WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
45         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
46         (WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
47         (WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
48         (WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
49         * html/HTMLMediaElement.h:
50         * html/MediaElementSession.cpp:
51         (WebCore::restrictionName): Added support for new restriction.
52         * html/MediaElementSession.h:
53         * page/FrameView.cpp:
54         (WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
55         * page/Settings.in:
56         * platform/audio/PlatformMediaSession.cpp:
57         (WebCore::stateName): Add new "Autoplay" state.
58         (WebCore::interruptionName): Added new interruption type.
59         (WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
60         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
61         * platform/audio/PlatformMediaSession.h:
62         (WebCore::PlatformMediaSession::interruptionType): Added getter.
63         (WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
64         * platform/audio/PlatformMediaSessionManager.cpp:
65         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
66         * rendering/RenderElement.cpp:
67         (WebCore::RenderElement::RenderElement): Set new ivars.
68         (WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
69         (WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
70         (WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
71         (WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
72         * rendering/RenderElement.h:
73         * rendering/RenderView.cpp:
74         (WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
75         (WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
76         (WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
77         * rendering/RenderView.h:
78         * testing/Internals.cpp:
79         (WebCore::Internals::setMediaElementRestrictions): Support new restriction.
80
81 2015-12-02  Brady Eidson  <beidson@apple.com>
82
83         Modern IDB: IDBTransaction::error is not exposed.
84         https://bugs.webkit.org/show_bug.cgi?id=151752
85
86         Reviewed by Alex Christensen.
87
88         No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).
89
90         * Modules/indexeddb/client/IDBRequestImpl.cpp:
91         (WebCore::IDBClient::IDBRequest::dispatchEvent):
92         (WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
93         * Modules/indexeddb/client/IDBRequestImpl.h:
94         
95         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
96         (WebCore::IDBClient::IDBTransaction::error):
97         (WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
98         (WebCore::IDBClient::IDBTransaction::abort):
99         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
100         * Modules/indexeddb/client/IDBTransactionImpl.h:
101
102 2015-12-02  Adenilson Cavalcanti  <cavalcantii@gmail.com>
103
104         [css border] border-image doesn't honor border-style
105         https://bugs.webkit.org/show_bug.cgi?id=99922
106
107         Reviewed by Simon Fraser.
108
109         Ensure that WebKit will be compliant to css-backgrounds spec where a
110         border with an image will only be rendered if there is a style defined.
111
112         Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
113         Reference: http://www.w3.org/TR/css3-background/#border-style
114
115         From W3C discussion: "The fact that these properties set the style of the border is
116         normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html
117
118         Test: fast/borders/border-image-should-not-display.html
119
120         * rendering/style/BorderData.h:
121         (WebCore::BorderData::hasBorder):
122         (WebCore::BorderData::borderLeftWidth):
123         (WebCore::BorderData::borderRightWidth):
124         (WebCore::BorderData::borderTopWidth):
125         (WebCore::BorderData::borderBottomWidth):
126         * rendering/style/BorderValue.h:
127         (WebCore::BorderValue::nonZero):
128         (WebCore::BorderValue::isVisible):
129
130 2015-12-02  Eric Carlson  <eric.carlson@apple.com>
131
132         [MediaStream] Implement MediaStreamTrack.getSettings()
133         https://bugs.webkit.org/show_bug.cgi?id=151727
134
135         Reviewed by Jer Noble.
136
137         MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings. 
138
139         Test: fast/mediastream/MediaStreamTrack-getSettings.html
140
141         * CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
142         * DerivedSources.make: No more MediaSourceStates.idl.
143         * Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
144         * Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
145         (WebCore::MediaSourceSettings::create):
146         (WebCore::MediaSourceSettings::MediaSourceSettings):
147         (WebCore::MediaSourceSettings::facingMode):
148         (WebCore::MediaSourceStates::create): Deleted.
149         (WebCore::MediaSourceStates::MediaSourceStates): Deleted.
150         (WebCore::MediaSourceStates::sourceType): Deleted.
151         (WebCore::MediaSourceStates::facingMode): Deleted.
152         * Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.
153
154         MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
155         * Modules/mediastream/MediaSourceStates.cpp: Removed.
156         * Modules/mediastream/MediaSourceStates.h: Removed.
157         * Modules/mediastream/MediaSourceStates.idl: Removed.
158
159         * Modules/mediastream/MediaStreamCapabilities.cpp:
160         (WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
161           by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
162         (WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
163         (WebCore::MediaStreamCapabilities::facingMode): Ditto.
164
165         * Modules/mediastream/MediaStreamTrack.cpp:
166         (WebCore::MediaStreamTrack::getSettings): New.
167         (WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
168           private track returns.
169         (WebCore::MediaStreamTrack::trackSettingsChanged):
170         (WebCore::MediaStreamTrack::states): Deleted.
171         (WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
172         * Modules/mediastream/MediaStreamTrack.h:
173         * Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.
174
175         * Modules/webaudio/MediaStreamAudioSource.cpp:
176         (WebCore::MediaStreamAudioSource::settings):
177         (WebCore::MediaStreamAudioSource::states): Deleted.
178         * Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.
179
180         * WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.
181
182         * bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
183         * bindings/js/JSMediaStreamTrackCustom.cpp: Added.
184         (WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so 
185           it has to be generated manually.
186
187         * platform/mediastream/MediaStreamPrivate.cpp:
188         (WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
189         (WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
190         * platform/mediastream/MediaStreamPrivate.h:
191
192         * platform/mediastream/MediaStreamTrackPrivate.cpp:
193         (WebCore::MediaStreamTrackPrivate::settings):
194         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
195         (WebCore::MediaStreamTrackPrivate::states): Deleted.
196         (WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
197         * platform/mediastream/MediaStreamTrackPrivate.h:
198
199         * platform/mediastream/RealtimeMediaSource.cpp:
200         (WebCore::RealtimeMediaSource::settingsDidChanged):
201         (WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
202         * platform/mediastream/RealtimeMediaSource.h:
203
204         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
205         (WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
206         (WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
207         (WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
208         (WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
209         (WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.
210
211         * platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
212         * platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
213         (WebCore::RealtimeMediaSourceSettings::facingMode):
214         (WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
215         (WebCore::RealtimeMediaSourceStates::sourceType): Deleted.
216
217         * platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
218         * platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.
219
220         * platform/mediastream/RealtimeMediaSourceStates.h: Removed.
221         * platform/mediastream/mac/AVAudioCaptureSource.h:
222         * platform/mediastream/mac/AVAudioCaptureSource.mm:
223         (WebCore::AVAudioCaptureSource::updateStates): Deleted.
224
225         * platform/mediastream/mac/AVCaptureDeviceManager.h:
226         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
227
228         * platform/mediastream/mac/AVMediaCaptureSource.h:
229         * platform/mediastream/mac/AVMediaCaptureSource.mm:
230         (WebCore::AVMediaCaptureSource::states): Deleted.
231
232         * platform/mediastream/mac/AVVideoCaptureSource.h:
233         * platform/mediastream/mac/AVVideoCaptureSource.mm:
234         (WebCore::AVVideoCaptureSource::updateStates): Deleted.
235
236         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
237
238         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
239
240         * platform/mock/MockRealtimeAudioSource.cpp:
241         (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
242         (WebCore::MockRealtimeAudioSource::updateStates): Deleted.
243         * platform/mock/MockRealtimeAudioSource.h:
244
245         * platform/mock/MockRealtimeMediaSource.cpp:
246         (WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
247         (WebCore::MockRealtimeMediaSource::settings):
248         (WebCore::MockRealtimeMediaSource::supportedConstraints):
249         (WebCore::MockRealtimeMediaSource::states): Deleted.
250         * platform/mock/MockRealtimeMediaSource.h:
251         (WebCore::MockRealtimeMediaSource::constraints):
252         (WebCore::MockRealtimeMediaSource::currentStates): Deleted.
253
254         * platform/mock/MockRealtimeVideoSource.cpp:
255         (WebCore::MockRealtimeVideoSource::updateSettings):
256         (WebCore::MockRealtimeVideoSource::initializeCapabilities):
257         (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
258         (WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
259         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
260         (WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
261         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
262         (WebCore::MockRealtimeVideoSource::updateStates): Deleted.
263         (WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
264         * platform/mock/MockRealtimeVideoSource.h:
265
266 2015-11-30  David Hyatt  <hyatt@apple.com>
267
268         Implement the picture element.
269         https://bugs.webkit.org/show_bug.cgi?id=116963
270
271         Reviewed by Dean Jackson.
272
273         Added fast/picture tests.
274
275         * WebCore.xcodeproj/project.pbxproj:
276         Add HTMLPictureElement.* to the project.
277
278         * html/HTMLImageElement.cpp:
279         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
280         Remove the CURRENT_SRC ifdef.
281
282         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
283         New helper function that checks the <source> elements of a <picture> parent
284         for the best match.
285
286         (WebCore::HTMLImageElement::selectImageSource):
287         Pull out the process of image selection into its own function so that this can
288         be called from many places (to ensure that dynamic changes are reflected as elements
289         get changed, added or removed).
290
291         (WebCore::HTMLImageElement::parseAttribute):
292         Call selectImageSource when attributes change.
293
294         (WebCore::HTMLImageElement::insertedInto):
295         If inserted into a picture element, make sure to update the source.
296
297         * html/HTMLImageElement.h:
298         (WebCore::HTMLImageElement::currentSrc):
299         Remove the CURRENT_SRC ifdef.
300
301         * html/HTMLImageElement.idl:
302         Remove the CURRENT_SRC ifdef.
303
304         * html/HTMLPictureElement.cpp: Added.
305         (WebCore::HTMLPictureElement::HTMLPictureElement):
306         (WebCore::HTMLPictureElement::create):
307         (WebCore::HTMLPictureElement::sourcesChanged):
308         * html/HTMLPictureElement.h: Added.
309         The new picture element. Has a sourcesChanged() function that is invoked whenever anything
310         about the <source> elements changes.
311
312         * html/HTMLSourceElement.cpp:
313         (WebCore::HTMLSourceElement::insertedInto):
314         (WebCore::HTMLSourceElement::removedFrom):
315         (WebCore::HTMLSourceElement::parseAttribute):
316         Make sure to call sourcesChanged when new sources come and go or when attributes on
317         source elements change.
318
319         * html/HTMLSourceElement.h:
320         Added parseAttribute function so we can see when attributes change that force us to
321         do a dynamic update.
322
323         * html/HTMLTagNames.in:
324         Add the picture element.
325
326         * html/parser/HTMLSrcsetParser.h:
327         (WebCore::ImageCandidate::srcOrigin):
328         (WebCore::ImageCandidate::isEmpty):
329         Some helpers for picture parsing.
330
331 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
332
333         [WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
334         https://bugs.webkit.org/show_bug.cgi?id=151757
335
336         Reviewed by Alex Christensen.
337
338         We need to make sure we use the same bitmap format as in the Direct3D surface
339         in video memory when copying surface data and rendering with Cairo.
340
341         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
342         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
343         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
344
345 2015-12-02  Brady Eidson  <beidson@apple.com>
346
347         Modern IDB: Get rid of IDBExceptionCode.
348         https://bugs.webkit.org/show_bug.cgi?id=151753
349
350         Reviewed by Alex Christensen.
351
352         No new tests (No change in behavior).
353
354         * Modules/indexeddb/client/IDBIndexImpl.cpp:
355         (WebCore::IDBClient::IDBIndex::count):
356         (WebCore::IDBClient::IDBIndex::doCount):
357         (WebCore::IDBClient::IDBIndex::get):
358         (WebCore::IDBClient::IDBIndex::doGet):
359         (WebCore::IDBClient::IDBIndex::getKey):
360         (WebCore::IDBClient::IDBIndex::doGetKey):
361         
362         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
363         (WebCore::IDBClient::IDBObjectStore::get):
364         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
365         (WebCore::IDBClient::IDBObjectStore::clear):
366         (WebCore::IDBClient::IDBObjectStore::createIndex):
367         (WebCore::IDBClient::IDBObjectStore::index):
368         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
369         (WebCore::IDBClient::IDBObjectStore::count):
370         (WebCore::IDBClient::IDBObjectStore::doCount):
371         
372         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
373         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
374         
375         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
376         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
377         
378         * Modules/indexeddb/server/IndexValueStore.cpp:
379         (WebCore::IDBServer::IndexValueStore::addRecord):
380         
381         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
382         (WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
383         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
384         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
385         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
386         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
387         (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
388         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
389         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
390         (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
391         (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
392         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
393         (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
394         (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
395         (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
396         (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
397         
398         * Modules/indexeddb/server/MemoryIndex.cpp:
399         (WebCore::IDBServer::MemoryIndex::putIndexKey):
400         
401         * Modules/indexeddb/server/MemoryObjectStore.cpp:
402         (WebCore::IDBServer::MemoryObjectStore::createIndex):
403         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
404         
405         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
406         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
407         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
408         
409         * Modules/indexeddb/shared/IDBError.cpp:
410         (WebCore::IDBError::IDBError):
411         (WebCore::IDBError::name):
412         (WebCore::IDBError::message):
413         (WebCore::idbErrorName): Deleted.
414         (WebCore::idbErrorDescription): Deleted.
415         
416         * Modules/indexeddb/shared/IDBError.h:
417         (WebCore::IDBError::code):
418         (WebCore::IDBError::isNull):
419
420 2015-12-02  Jiewen Tan  <jiewen_tan@apple.com>
421
422         Null dereference loading Blink layout test fast/loader/unload-mutation-crash.html
423         https://bugs.webkit.org/show_bug.cgi?id=149305
424         <rdar://problem/22747892>
425
426         Reviewed by Brent Fulgham.
427
428         Add an extra guard to replaceDocument() against rude JS in unload event handlers.
429
430         Test: fast/loader/unload-mutation-crash.html
431
432         * loader/DocumentWriter.cpp:
433         (WebCore::DocumentWriter::replaceDocument):
434         (WebCore::DocumentWriter::begin):
435
436 2015-12-02  Per Arne Vollan  <peavo@outlook.com>
437
438         [WinCairo] Compile error.
439         https://bugs.webkit.org/show_bug.cgi?id=151742
440
441         Reviewed by Csaba Osztrogon├íc.
442
443         System font flag has moved from Font class to FontData class.
444
445         * platform/graphics/win/SimpleFontDataCairoWin.cpp:
446         (WebCore::Font::platformInit):
447
448 2015-12-01  Commit Queue  <commit-queue@webkit.org>
449
450         Unreviewed, rolling out r192894 and r192904.
451         https://bugs.webkit.org/show_bug.cgi?id=151738
452
453         Crashes sometimes on Windows (Requested by litherum on
454         #webkit).
455
456         Reverted changesets:
457
458         "[Win] Web fonts with small caps have excess whitespace with
459         the complex text codepath"
460         https://bugs.webkit.org/show_bug.cgi?id=151698
461         http://trac.webkit.org/changeset/192894
462
463         "Test gardening after r192894"
464         http://trac.webkit.org/changeset/192904
465
466 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
467
468         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
469         https://bugs.webkit.org/show_bug.cgi?id=150792
470
471         Reviewed by Saam Barati.
472
473         * Configurations/FeatureDefines.xcconfig:
474
475 2015-12-01  Commit Queue  <commit-queue@webkit.org>
476
477         Unreviewed, rolling out r192914.
478         https://bugs.webkit.org/show_bug.cgi?id=151734
479
480         JSC tests for this change are failing on 32 and 64-bit bots
481         (Requested by ryanhaddad on #webkit).
482
483         Reverted changeset:
484
485         "[ES6] Implement LLInt/Baseline Support for ES6 Generators and
486         enable this feature"
487         https://bugs.webkit.org/show_bug.cgi?id=150792
488         http://trac.webkit.org/changeset/192914
489
490 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
491
492         [SVG -> OTF Converter] Force UnitsPerEm to 1000
493         https://bugs.webkit.org/show_bug.cgi?id=151650
494
495         Reviewed by Antti Koivisto.
496
497         According to the Adobe Type 1 Font Format:
498
499         "Type 1 font programs generally use a 1000 to 1 scaling matrix
500         for the definition of the relationship of character space unites
501         to user space units."
502
503         Windows actually disregards the "unitsPerEm" value in the "head"
504         table for some calculations, and hardcodes 1000 instead. In order
505         to have consistent renderings on Windows and OS X, this patch
506         forces all generated fonts to have a unitsPerEm of 1000, and
507         appropriately scales all necessary values.
508
509         Test: svg/W3C-SVG-1.1/fonts-elem-03-b.svg
510
511         * svg/SVGToOTFFontConversion.cpp:
512         (WebCore::SVGToOTFFontConverter::scaleUnitsPerEm):
513         (WebCore::SVGToOTFFontConverter::appendHEADTable):
514         (WebCore::SVGToOTFFontConverter::appendOS2Table):
515         (WebCore::SVGToOTFFontConverter::appendVORGTable):
516         (WebCore::SVGToOTFFontConverter::appendVHEATable):
517         (WebCore::SVGToOTFFontConverter::appendVMTXTable):
518         (WebCore::SVGToOTFFontConverter::addKerningPair):
519         (WebCore::CFFBuilder::CFFBuilder):
520         (WebCore::CFFBuilder::boundingBox):
521         (WebCore::CFFBuilder::updateBoundingBox):
522         (WebCore::CFFBuilder::unscaledLineTo):
523         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
524         (WebCore::SVGToOTFFontConverter::processGlyphElement):
525         (WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
526         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
527
528 2015-12-01  Brady Eidson  <beidson@apple.com>
529
530         Give a more detailed message for TypeErrors that result from EnforceRange.
531         https://bugs.webkit.org/show_bug.cgi?id=151725
532
533         Reviewed by Tim Horton.
534
535         No new tests (Covered by changes to existing tests).
536
537         * bindings/js/JSDOMBinding.cpp:
538         (WebCore::rangeErrorString):
539         (WebCore::enforceRange):
540
541 2015-12-01  Jer Noble  <jer.noble@apple.com>
542
543         [iOS] Abrupt transition between Fullscreen -> PiP
544         https://bugs.webkit.org/show_bug.cgi?id=151719
545
546         Reviewed by Eric Carlson.
547
548         Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.
549
550         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
551         (WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):
552
553 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
554
555         Give String and AtomicString an existingHash() function
556         https://bugs.webkit.org/show_bug.cgi?id=151717
557
558         Reviewed by Andreas Kling.
559
560         No new tests because there is no behavior change.
561
562         * platform/graphics/Font.cpp:
563         (WebCore::CharacterFallbackMapKeyHash::hash):
564
565 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
566
567         [Win] Build fix after r192895
568
569         Unreviewed.
570
571         * platform/graphics/FontPlatformData.h:
572         (WebCore::FontPlatformData::isSystemFont):
573         (WebCore::FontPlatformData::setIsSystemFont):
574         * platform/graphics/win/SimpleFontDataCGWin.cpp:
575         (WebCore::Font::platformInit):
576         (WebCore::Font::platformWidthForGlyph):
577
578 2015-12-01  Alexey Proskuryakov  <ap@apple.com>
579
580         Update bindings test results after r192903.
581
582         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
583         (WebCore::JSTestEventConstructorConstructor::construct):
584
585 2015-12-01  Yusuke Suzuki  <utatane.tea@gmail.com>
586
587         [ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
588         https://bugs.webkit.org/show_bug.cgi?id=150792
589
590         Reviewed by Saam Barati.
591
592         * Configurations/FeatureDefines.xcconfig:
593
594 2015-12-01  Brady Eidson  <beidson@apple.com>
595
596         Add "RaisesExceptionWithMessage" IDL attribute.
597         https://bugs.webkit.org/show_bug.cgi?id=151720
598
599         Reviewed by Alex Christensen.
600
601         No new tests (Covered by changes to existing bindings tests).
602
603         * bindings/scripts/CodeGeneratorJS.pm:
604         (GenerateImplementation):
605         (GenerateParametersCheck):
606         (GenerateReturnParameters):
607         (GenerateImplementationFunctionCall):
608         (GenerateConstructorDefinition):
609         
610         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
611         (webkit_dom_test_obj_method_with_exception_with_message):
612         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
613         
614         * bindings/scripts/test/JS/JSTestObj.cpp:
615         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
616         
617         * bindings/scripts/test/ObjC/DOMTestObj.h:
618         * bindings/scripts/test/ObjC/DOMTestObj.mm:
619         (-[DOMTestObj methodWithExceptionWithMessage]):
620         
621         * bindings/scripts/test/TestObj.idl:
622
623 2015-12-01  Darin Adler  <darin@apple.com>
624
625         Fix anomaly where isMouseEvent returns false for wheel events
626         https://bugs.webkit.org/show_bug.cgi?id=151685
627
628         Reviewed by Alexey Proskuryakov.
629
630         Back three years ago when we made WheelEvent inherit from MouseEvent,
631         someone decided that isMouseEvent should return false for the wheel events.
632         An audit of all the callers of isMouseEvent indicated that in almost every
633         case, it's better to return true, so this patch does that.
634
635         All the other call sites that were checking isMouseEvent, here and in the
636         higher levels of WebKit, benefit from getting true even for wheel events.
637
638         * bindings/objc/DOMEvents.mm:
639         (kitClass): Use eventInterface instead of isMouseEvent to create the appropriate
640         wrapper class.
641
642         * bindings/scripts/CodeGeneratorJS.pm:
643         (GenerateConstructorDefinition): Eliminated a peculiar search and replace
644         mistake; "stateution" instead of "execution".
645
646         * dom/Node.cpp:
647         (WebCore::Node::handleLocalEvents): Add an isWheelEvent check here so that we
648         will not ignore wheel events. This preserves behavior. A FIXME questions whether
649         that is the behavior we want.
650
651         * dom/WheelEvent.cpp:
652         (WebCore::WheelEvent::isMouseEvent): Deleted. No need to override and return false.
653         * dom/WheelEvent.h: Ditto.
654
655         * html/HTMLTextAreaElement.cpp:
656         (WebCore::HTMLTextAreaElement::defaultEventHandler): Removed unneeded checks for
657         drag events and wheel events; both are types of mouse event, and so a single
658         isMouseEvent check takes care of all three of these.
659         * html/TextFieldInputType.cpp:
660         (WebCore::TextFieldInputType::forwardEvent): Ditto.
661
662 2015-12-01  Alex Christensen  <achristensen@webkit.org>
663
664         Use Optional for matrix inverses
665         https://bugs.webkit.org/show_bug.cgi?id=151575
666
667         Reviewed by Myles C. Maxfield.
668
669         This patch should have no change in behavior.  Some unnecessary checks are removed.
670         There are a few places where we are no longer multiplying by the identity matrix.
671         This should remind future coders that not all matrices are invertible.
672
673         * css/WebKitCSSMatrix.cpp:
674         (WebCore::WebKitCSSMatrix::inverse):
675         (WebCore::WebKitCSSMatrix::translate):
676         * html/canvas/CanvasRenderingContext2D.cpp:
677         (WebCore::CanvasRenderingContext2D::restore):
678         (WebCore::CanvasRenderingContext2D::scale):
679         (WebCore::CanvasRenderingContext2D::rotate):
680         (WebCore::CanvasRenderingContext2D::translate):
681         (WebCore::CanvasRenderingContext2D::transform):
682         (WebCore::CanvasRenderingContext2D::setTransform):
683         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
684         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
685         * platform/graphics/GraphicsContext.cpp:
686         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
687         * platform/graphics/ShadowBlur.cpp:
688         (WebCore::ShadowBlur::calculateLayerBoundingRect):
689         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
690         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
691         * platform/graphics/cg/ImageBufferCG.cpp:
692         (WebCore::ImageBuffer::putByteArray):
693         * platform/graphics/filters/Filter.h:
694         (WebCore::Filter::setFilterScale):
695         (WebCore::Filter::absoluteTransform):
696         (WebCore::Filter::mapAbsolutePointToLocalPoint):
697         (WebCore::Filter::renderingMode):
698         (WebCore::Filter::setRenderingMode):
699         * platform/graphics/texmap/TextureMapperLayer.cpp:
700         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
701         (WebCore::TextureMapperLayer::replicaTransform):
702         (WebCore::TextureMapperLayer::setAnimatedFilters):
703         (WebCore::TextureMapperLayer::mapScrollOffset):
704         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
705         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
706         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
707         * platform/graphics/transforms/AffineTransform.cpp:
708         (WebCore::AffineTransform::yScale):
709         (WebCore::det):
710         (WebCore::AffineTransform::isInvertible):
711         (WebCore::AffineTransform::inverse):
712         (WebCore::AffineTransform::det): Deleted.
713         * platform/graphics/transforms/AffineTransform.h:
714         * platform/graphics/transforms/TransformState.cpp:
715         (WebCore::TransformState::mappedPoint):
716         (WebCore::TransformState::mappedQuad):
717         (WebCore::TransformState::mapQuad):
718         (WebCore::TransformState::flattenWithTransform):
719         * platform/graphics/transforms/TransformationMatrix.cpp:
720         (WebCore::TransformationMatrix::isInvertible):
721         (WebCore::TransformationMatrix::inverse):
722         * platform/graphics/transforms/TransformationMatrix.h:
723         * rendering/HitTestingTransformState.cpp:
724         (WebCore::HitTestingTransformState::flattenWithTransform):
725         (WebCore::HitTestingTransformState::mappedPoint):
726         (WebCore::HitTestingTransformState::mappedQuad):
727         (WebCore::HitTestingTransformState::mappedArea):
728         (WebCore::HitTestingTransformState::boundsOfMappedArea):
729         * rendering/PaintInfo.h:
730         (WebCore::PaintInfo::applyTransform):
731         * rendering/RenderLayer.cpp:
732         (WebCore::RenderLayer::paintLayerByApplyingTransform):
733         (WebCore::RenderLayer::hitTestLayer):
734         * rendering/svg/RenderSVGContainer.cpp:
735         (WebCore::RenderSVGContainer::nodeAtFloatPoint):
736         * rendering/svg/RenderSVGForeignObject.cpp:
737         (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
738         * rendering/svg/RenderSVGImage.cpp:
739         (WebCore::RenderSVGImage::nodeAtFloatPoint):
740         * rendering/svg/RenderSVGResourceClipper.cpp:
741         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
742         * rendering/svg/RenderSVGResourceFilter.cpp:
743         (WebCore::RenderSVGResourceFilter::postApplyResource):
744         * rendering/svg/RenderSVGRoot.cpp:
745         (WebCore::RenderSVGRoot::nodeAtPoint):
746         * rendering/svg/RenderSVGShape.cpp:
747         (WebCore::RenderSVGShape::setupNonScalingStrokeContext):
748         (WebCore::RenderSVGShape::nodeAtFloatPoint):
749         (WebCore::RenderSVGShape::calculateStrokeBoundingBox):
750         * rendering/svg/RenderSVGText.cpp:
751         (WebCore::RenderSVGText::nodeAtFloatPoint):
752         * rendering/svg/SVGRenderSupport.cpp:
753         (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
754         * rendering/svg/SVGRenderingContext.cpp:
755         (WebCore::SVGRenderingContext::clipToImageBuffer):
756         * svg/SVGLocatable.cpp:
757         (WebCore::SVGLocatable::getTransformToElement):
758         * svg/SVGMatrix.h:
759         (WebCore::SVGMatrix::inverse):
760         (WebCore::SVGMatrix::rotateFromVector):
761
762 2015-12-01  Tim Horton  <timothy_horton@apple.com>
763
764         Remove swipe snapshot before main document load if scroll position is already restored
765         https://bugs.webkit.org/show_bug.cgi?id=151224
766
767         Reviewed by Darin Adler.
768
769         * loader/FrameLoaderClient.h:
770         * loader/HistoryController.cpp:
771         (WebCore::HistoryController::restoreScrollPositionAndViewState):
772         Each time we try to restore the scroll position, see if the requested
773         scroll position is something we can scroll to by going through ScrollView's
774         scroll position constraint logic. If we can scroll there, tell our client
775         (and eventually ViewGestureController) that we successfully restored the
776         scroll position!
777
778 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
779
780         [iOS] Adjacent emoji overlap each other
781         https://bugs.webkit.org/show_bug.cgi?id=151690
782         <rdar://problem/23430453>
783
784         Reviewed by Simon Fraser.
785
786         This is a partial revert of r188737. It turns out that only CoreText gives correct
787         glyph advances for emoji. In r188737, I reverted the special iOS emoji processing,
788         but also removed the logic of using CoreText for emoji advances. This patch adds
789         the m_isEmoji boolean back, so we can tell if we need to force
790         platformWidthForGlyph() to use CoreText.
791
792         This patch also performs a little bit of cleanup by moving Font's m_isSystemFont
793         to FontPlatformData where it belongs.
794
795         Test: fast/text/emoji-overlap.html
796
797         * platform/graphics/Font.cpp:
798         (WebCore::fillGlyphPage): Removed unnecessary argument.
799         (WebCore::Font::Font): Deleted.
800         * platform/graphics/Font.h: Moved getters and booleans to FontPlatformData.
801         (WebCore::Font::hasCustomTracking): Deleted.
802         (WebCore::Font::isSystemFont): Deleted.
803         * platform/graphics/FontPlatformData.cpp:
804         (WebCore::FontPlatformData::FontPlatformData): Initialize new booleans.
805         (WebCore::FontPlatformData::operator=): Ditto.
806         * platform/graphics/FontPlatformData.h: Getters for new booleans.
807         (WebCore::FontPlatformData::isSystemFont):
808         (WebCore::FontPlatformData::hasCustomTracking):
809         (WebCore::FontPlatformData::isEmoji):
810         * platform/graphics/GlyphPage.h: Remove unnecessary argument.
811         * platform/graphics/cocoa/FontCocoa.mm:
812         (WebCore::advanceForColorBitmapFont): Return an Optional instead of using an out
813         argument.
814         (WebCore::canUseFastGlyphAdvanceGetter): Make sure that we use CoreText if we are
815         using the Emoji font.
816         (WebCore::Font::platformWidthForGlyph):
817         (WebCore::Font::platformInit): Deleted.
818         * platform/graphics/cocoa/FontPlatformDataCocoa.mm: Deal with the new booleans.
819         (WebCore::FontPlatformData::FontPlatformData):
820         (WebCore::FontPlatformData::platformDataInit):
821         (WebCore::FontPlatformData::platformDataAssign):
822         (WebCore::FontPlatformData::setFont):
823         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
824         (WebCore::GlyphPage::fill): Removed unnecessary argument.
825         * platform/graphics/mac/GlyphPageMac.cpp:
826         (WebCore::shouldUseCoreText): Use a reference instead of a pointer.
827         (WebCore::GlyphPage::fill): Removed unnecessary argument.
828         * platform/graphics/win/FontCGWin.cpp:
829         (WebCore::FontCascade::drawGlyphs): Update for new location of booleans.
830         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
831         (WebCore::GlyphPage::fill): Removed unnecessary argument.
832         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
833         (WebCore::GlyphPage::fill): Removed unnecessary argument.
834         * platform/graphics/win/UniscribeController.cpp:
835         (WebCore::UniscribeController::shapeAndPlaceItem): Update for new location of
836         booleans.
837
838 2015-12-01  Myles C. Maxfield  <mmaxfield@apple.com>
839
840         [Win] Web fonts with small caps have excess whitespace with the complex text codepath
841         https://bugs.webkit.org/show_bug.cgi?id=151698
842
843         Reviewed by Darin Adler.
844
845         When performing small-caps on OS X, we bake in the smaller font size into the platform's native font
846         object. On Windows, we currently don't do that; instead, we just change some ancillary data inside
847         the FontPlatformData, and our advance & drawing calculations are sensitive to this ancillary data.
848         However, in the complex text codepath, Uniscribe only takes the native font object as input, and
849         therefore operates with the wrong font size.
850
851         The solution is to bake the smaller font size into the native platform font on Windows, similar to
852         OS X. It isn't clear why we didn't do this previously, but it seems like we weren't sure that
853         Windows would select the correct font when we provide new selection criteria. However, for web fonts,
854         we already use the same mechanism (CreateFontIndirect()) when we create the font in the first place;
855         therefore, this scaled font request will always work as well.
856
857         Test: fast/text/small-caps-complex.html
858
859         * platform/graphics/win/SimpleFontDataWin.cpp:
860         (WebCore::Font::platformCreateScaledFont): Deleted.
861
862 2015-12-01  Brady Eidson  <beidson@apple.com>
863
864         Modern IDB: storage/indexeddb/create-and-remove-object-store.html fails.
865         https://bugs.webkit.org/show_bug.cgi?id=151704
866
867         Reviewed by Alex Christensen.
868
869         No new tests (At least one previously failing test now passes).
870
871         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
872         (WebCore::IDBClient::IDBDatabase::deleteObjectStore):
873
874 2015-12-01  Brady Eidson  <beidson@apple.com>
875
876         Modern IDB: storage/indexeddb/basics.html fails.
877         https://bugs.webkit.org/show_bug.cgi?id=151694
878
879         Reviewed by Alex Christensen.
880
881         No new tests (At least one failing test now passes, and covered by changes to 3 previously incorrect tests).
882
883         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
884         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Set the flag determining whether
885           or not the request's transaction should be exposed to the DOM.
886         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
887         
888         * Modules/indexeddb/client/IDBRequestImpl.cpp:
889         (WebCore::IDBClient::IDBRequest::result): Throw an exception if the request is not done.
890         (WebCore::IDBClient::IDBRequest::error): Ditto.
891         (WebCore::IDBClient::IDBRequest::transaction): Only return the transaction to the DOM if the flag says so.
892         * Modules/indexeddb/client/IDBRequestImpl.h:
893         
894         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
895         (WebCore::IDBClient::IDBTransaction::abort):
896         (WebCore::IDBClient::IDBTransaction::commit):
897
898 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
899
900         [GTK] ASSERTION FAILED: m_table running /webkit2/BackForwardList/navigation in Debug build
901         https://bugs.webkit.org/show_bug.cgi?id=151700
902
903         Reviewed by Martin Robinson.
904
905         This happens when the frame notifies its observers that the page
906         will be detached. The m_table that asserts is the
907         FrameDestructionObserver HashSet. It happens when clearing the
908         GObject DOM cache wrappers during frame destruction, and there's a
909         Document object wrapped whose last reference is held by the DOM
910         wrapper. In that case, the Document object is destroyed while the
911         frame is being destroyed. Deleting the wrapper objects after the
912         frame destruction fixes the crash.
913
914         * bindings/gobject/DOMObjectCache.cpp:
915
916 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
917
918         [Streams API] pull function of tee should call readFromReadableStreamReader directly
919         https://bugs.webkit.org/show_bug.cgi?id=151497
920
921         Reviewed by Darin Adler.
922
923         Covered by added test.
924
925         * Modules/streams/ReadableStreamInternals.js:
926         (teeReadableStreamPullFunction): directly calling readFromReadableStreamReader.
927
928 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
929
930         [Streams API] Clean-up JS built-in code using arrow functions
931         https://bugs.webkit.org/show_bug.cgi?id=151489
932
933         Reviewed by Darin Adler.
934
935         Using arrow functions to remove need for _this.
936         Made errorWritableStream take two parameters to simplify code and align it with the spec.
937
938         No change in behavior.
939
940         * Modules/streams/ReadableStream.js:
941         (initializeReadableStream):
942         * Modules/streams/WritableStream.js:
943         (initializeWritableStream):
944         (abort):
945         (write):
946         * Modules/streams/WritableStreamInternals.js:
947         (errorWritableStream):
948         (writableStreamAdvanceQueue):
949         (closeWritableStream):
950
951 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
952
953         [Streams API] teeReadableStream should not directly use stream.getReader()
954         https://bugs.webkit.org/show_bug.cgi?id=151487
955
956         Reviewed by Darin Adler.
957
958         Covered by added test.
959
960         * Modules/streams/ReadableStreamInternals.js:
961         (teeReadableStream): Create a @ReadableStreamReader instead of calling getReader() which may be disrupted by user scripts.
962
963 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
964
965         [Streams API] streams should not directly use Number and related methods
966         https://bugs.webkit.org/show_bug.cgi?id=151499
967
968         Reviewed by Darin Adler.
969
970         Covered by updated test.
971
972         Using @Number, @isFinite and @isNaN in place of Number, Number.isFinite and Number.isNaN.
973
974         * Modules/streams/ReadableStreamInternals.js:
975         (enqueueInReadableStream):
976         * Modules/streams/StreamInternals.js:
977         (validateAndNormalizeQueuingStrategy):
978         (enqueueValueWithSize):
979
980 2015-12-01  Carlos Garcia Campos  <cgarcia@igalia.com>
981
982         Unreviewed. Fix GTK+ build after r192849.
983
984         * bindings/scripts/CodeGeneratorGObject.pm:
985         (GenerateFunction):
986         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
987         (webkit_dom_test_interface_supplemental_method1):
988         (webkit_dom_test_interface_supplemental_method2):
989         (webkit_dom_test_interface_set_supplemental_str2):
990         (webkit_dom_test_interface_get_supplemental_node):
991         (webkit_dom_test_interface_set_supplemental_node):
992
993 2015-12-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
994
995         [Streams API] Remove use of @catch for exposed promises
996         https://bugs.webkit.org/show_bug.cgi?id=151625
997
998         Reviewed by Darin Adler.
999
1000         Promise @catch is calling "then" which may be controlled by user scripts.
1001         This patch simply replaces @catch by calling @then directly.
1002
1003         Covered by modified tests.
1004
1005         * Modules/streams/ReadableStream.js:
1006         (pipeTo):
1007         * Modules/streams/ReadableStreamInternals.js:
1008         (teeReadableStream):
1009
1010 2015-11-30  Jaehun Lim  <ljaehun.lim@samsung.com>
1011
1012         Unreviewed, fix build after r192848 and r192849
1013
1014         - Rename canSuspendForPageCache to canSuspendForDocumentSuspension
1015         - Use references instead of pointers
1016
1017         * Modules/battery/BatteryManager.cpp:
1018         (WebCore::BatteryManager::canSuspendForDocumentSuspension):
1019         (WebCore::BatteryManager::canSuspendForPageCache): Deleted.
1020         * Modules/battery/BatteryManager.h:
1021         * Modules/battery/NavigatorBattery.cpp:
1022         (WebCore::NavigatorBattery::webkitBattery):
1023         * Modules/battery/NavigatorBattery.h:
1024         * Modules/gamepad/deprecated/NavigatorGamepad.cpp:
1025         (WebCore::NavigatorGamepad::webkitGetGamepads):
1026         * Modules/gamepad/deprecated/NavigatorGamepad.h:
1027         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1028         (WebCore::NavigatorContentUtils::registerProtocolHandler):
1029         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1030         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
1031         * Modules/navigatorcontentutils/NavigatorContentUtils.h:
1032         * Modules/vibration/NavigatorVibration.cpp:
1033         (WebCore::NavigatorVibration::vibrate):
1034         * Modules/vibration/NavigatorVibration.h:
1035
1036 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
1037
1038         Amazon.com Additional Information links aren't clickable
1039         https://bugs.webkit.org/show_bug.cgi?id=151401
1040         <rdar://problem/23454261>
1041
1042         Reviewed by Darin Adler.
1043
1044         The cause of this issue is that the painting order is different from the hittest order so we can end up
1045         with visible but unreachable content. To fix this, the executation flow of hittest has been reordered.
1046         According to the paint system, which renders the webpage from the bottom RenderLayer to the top, contents
1047         are rendered before floats. Hence, for the hittest, which determines the hitted location from top RenderLayer
1048         to the bottom, should do it reversedly. Now, hittest will first test floats then contents.
1049
1050         Test: fast/block/float/hit-test-on-overlapping-floats.html
1051
1052         * rendering/RenderBlock.cpp:
1053         (WebCore::RenderBlock::nodeAtPoint):
1054
1055 2015-11-30  Simon Fraser  <simon.fraser@apple.com>
1056
1057         Fix possible crash with animated layers in reflections
1058         https://bugs.webkit.org/show_bug.cgi?id=151689
1059         rdar://problem/23018612
1060
1061         Reviewed by Darin Adler.
1062
1063         Reflections create additional PlatformCALayers whose owner is set to the GraphicsLayerCA.
1064         Those PlatformCALayers need their owner pointer cleared out when the GraphicsLayerCA
1065         is destroyed.
1066         
1067         Tested by compositing/reflections/nested-reflection-transition.html
1068
1069         * platform/graphics/ca/GraphicsLayerCA.cpp:
1070         * platform/graphics/ca/GraphicsLayerCA.h:
1071
1072 2015-11-30  Brady Eidson  <beidson@apple.com>
1073
1074         Modern IDB: Iterating index cursors to a specific key is busted.
1075         https://bugs.webkit.org/show_bug.cgi?id=151684
1076
1077         Reviewed by Darin Adler.
1078
1079         No new tests (At least one failing test now passes).
1080
1081         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1082         (WebCore::IDBServer::MemoryIndexCursor::iterate):
1083
1084 2015-11-30  Brady Eidson  <beidson@apple.com>
1085
1086         Modern IDB: ObjectStore cursors should not be able to iterate out of their range.
1087         https://bugs.webkit.org/show_bug.cgi?id=151683
1088
1089         Reviewed by Darin Adler.
1090
1091         No new tests (Covered by at least one failing test that now passes).
1092
1093         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1094         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1095         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1096
1097 2015-11-30  Anders Carlsson  <andersca@apple.com>
1098
1099         CTTE autogenerated bindings code
1100         https://bugs.webkit.org/show_bug.cgi?id=151682
1101
1102         Reviewed by Darin Adler.
1103
1104         Make sure that JS bindings pass a reference to the object when calling static member functions.
1105
1106         * Modules/gamepad/NavigatorGamepad.cpp:
1107         (WebCore::NavigatorGamepad::getGamepads):
1108         * Modules/gamepad/NavigatorGamepad.h:
1109         * Modules/geolocation/NavigatorGeolocation.cpp:
1110         (WebCore::NavigatorGeolocation::geolocation):
1111         * Modules/geolocation/NavigatorGeolocation.h:
1112         * Modules/mediasource/AudioTrackMediaSource.h:
1113         (WebCore::AudioTrackMediaSource::sourceBuffer):
1114         * Modules/mediasource/TextTrackMediaSource.h:
1115         (WebCore::TextTrackMediaSource::sourceBuffer):
1116         * Modules/mediasource/VideoTrackMediaSource.h:
1117         (WebCore::VideoTrackMediaSource::sourceBuffer):
1118         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
1119         (WebCore::HTMLMediaElementMediaStream::srcObject):
1120         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
1121         * Modules/mediastream/HTMLMediaElementMediaStream.h:
1122         * Modules/mediastream/NavigatorMediaDevices.cpp:
1123         (WebCore::NavigatorMediaDevices::mediaDevices):
1124         * Modules/mediastream/NavigatorMediaDevices.h:
1125         * Modules/notifications/DOMWindowNotifications.cpp:
1126         (WebCore::DOMWindowNotifications::webkitNotifications):
1127         * Modules/notifications/DOMWindowNotifications.h:
1128         * Modules/notifications/Notification.cpp:
1129         (WebCore::Notification::Notification):
1130         * Modules/notifications/WorkerGlobalScopeNotifications.cpp:
1131         (WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
1132         * Modules/notifications/WorkerGlobalScopeNotifications.h:
1133         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
1134         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
1135         * Modules/speech/DOMWindowSpeechSynthesis.h:
1136         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1137         (WebCore::DOMWindowWebDatabase::openDatabase):
1138         * Modules/webdatabase/DOMWindowWebDatabase.h:
1139         * bindings/scripts/CodeGeneratorJS.pm:
1140         (GenerateImplementation):
1141         (GenerateParametersCheck):
1142         * testing/Internals.cpp:
1143         (WebCore::Internals::enableMockSpeechSynthesizer):
1144
1145 2015-11-30  Katlyn Graff  <kgraff@apple.com>
1146
1147         Rename ActiveDOMObject/DOMWindow PageCacheSuspension code to support more reasons for suspension
1148         https://bugs.webkit.org/show_bug.cgi?id=151677
1149
1150         Reviewed by Ryosuke Niwa.
1151
1152         Simply a refactoring patch, so no new tests.
1153
1154         * Modules/encryptedmedia/MediaKeySession.cpp:
1155         (WebCore::MediaKeySession::canSuspendForDocumentSuspension):
1156         (WebCore::MediaKeySession::canSuspendForPageCache): Deleted.
1157         * Modules/encryptedmedia/MediaKeySession.h:
1158         * Modules/geolocation/Geolocation.cpp:
1159         (WebCore::Geolocation::canSuspendForDocumentSuspension):
1160         (WebCore::Geolocation::canSuspendForPageCache): Deleted.
1161         * Modules/geolocation/Geolocation.h:
1162         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1163         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
1164         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
1165         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForPageCache): Deleted.
1166         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromPageCache): Deleted.
1167         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
1168         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1169         (WebCore::IDBClient::IDBDatabase::canSuspendForDocumentSuspension):
1170         (WebCore::IDBClient::IDBDatabase::canSuspendForPageCache): Deleted.
1171         * Modules/indexeddb/client/IDBDatabaseImpl.h:
1172         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1173         (WebCore::IDBClient::IDBRequest::canSuspendForDocumentSuspension):
1174         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache): Deleted.
1175         * Modules/indexeddb/client/IDBRequestImpl.h:
1176         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1177         (WebCore::IDBClient::IDBTransaction::canSuspendForDocumentSuspension):
1178         (WebCore::IDBClient::IDBTransaction::canSuspendForPageCache): Deleted.
1179         * Modules/indexeddb/client/IDBTransactionImpl.h:
1180         * Modules/indexeddb/legacy/LegacyDatabase.cpp:
1181         (WebCore::LegacyDatabase::canSuspendForDocumentSuspension):
1182         (WebCore::LegacyDatabase::canSuspendForPageCache): Deleted.
1183         * Modules/indexeddb/legacy/LegacyDatabase.h:
1184         * Modules/indexeddb/legacy/LegacyRequest.cpp:
1185         (WebCore::LegacyRequest::canSuspendForDocumentSuspension):
1186         (WebCore::LegacyRequest::canSuspendForPageCache): Deleted.
1187         * Modules/indexeddb/legacy/LegacyRequest.h:
1188         * Modules/indexeddb/legacy/LegacyTransaction.cpp:
1189         (WebCore::LegacyTransaction::canSuspendForDocumentSuspension):
1190         (WebCore::LegacyTransaction::canSuspendForPageCache): Deleted.
1191         * Modules/indexeddb/legacy/LegacyTransaction.h:
1192         * Modules/mediasource/MediaSource.cpp:
1193         (WebCore::MediaSource::canSuspendForDocumentSuspension):
1194         (WebCore::MediaSource::canSuspendForPageCache): Deleted.
1195         * Modules/mediasource/MediaSource.h:
1196         * Modules/mediasource/SourceBuffer.cpp:
1197         (WebCore::SourceBuffer::canSuspendForDocumentSuspension):
1198         (WebCore::SourceBuffer::canSuspendForPageCache): Deleted.
1199         * Modules/mediasource/SourceBuffer.h:
1200         * Modules/mediastream/MediaStreamTrack.cpp:
1201         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension):
1202         (WebCore::MediaStreamTrack::canSuspendForPageCache): Deleted.
1203         * Modules/mediastream/MediaStreamTrack.h:
1204         * Modules/mediastream/RTCDTMFSender.cpp:
1205         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension):
1206         (WebCore::RTCDTMFSender::canSuspendForPageCache): Deleted.
1207         * Modules/mediastream/RTCDTMFSender.h:
1208         * Modules/mediastream/RTCPeerConnection.cpp:
1209         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension):
1210         (WebCore::RTCPeerConnection::canSuspendForPageCache): Deleted.
1211         * Modules/mediastream/RTCPeerConnection.h:
1212         * Modules/notifications/DOMWindowNotifications.cpp:
1213         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
1214         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
1215         (WebCore::DOMWindowNotifications::disconnectFrameForPageCache): Deleted.
1216         (WebCore::DOMWindowNotifications::reconnectFrameFromPageCache): Deleted.
1217         * Modules/notifications/DOMWindowNotifications.h:
1218         * Modules/notifications/Notification.cpp:
1219         (WebCore::Notification::canSuspendForDocumentSuspension):
1220         (WebCore::Notification::canSuspendForPageCache): Deleted.
1221         * Modules/notifications/Notification.h:
1222         * Modules/notifications/NotificationCenter.cpp:
1223         (WebCore::NotificationCenter::canSuspendForDocumentSuspension):
1224         (WebCore::NotificationCenter::canSuspendForPageCache): Deleted.
1225         * Modules/notifications/NotificationCenter.h:
1226         * Modules/webaudio/AudioContext.cpp:
1227         (WebCore::AudioContext::canSuspendForDocumentSuspension):
1228         (WebCore::AudioContext::canSuspendForPageCache): Deleted.
1229         * Modules/webaudio/AudioContext.h:
1230         * Modules/webdatabase/DatabaseContext.cpp:
1231         (WebCore::DatabaseContext::canSuspendForDocumentSuspension):
1232         (WebCore::DatabaseContext::canSuspendForPageCache): Deleted.
1233         * Modules/webdatabase/DatabaseContext.h:
1234         * Modules/websockets/WebSocket.cpp:
1235         (WebCore::WebSocket::canSuspendForDocumentSuspension):
1236         (WebCore::WebSocket::canSuspendForPageCache): Deleted.
1237         * Modules/websockets/WebSocket.h:
1238         * css/FontLoader.cpp:
1239         (WebCore::FontLoader::canSuspendForDocumentSuspension):
1240         (WebCore::FontLoader::canSuspendForPageCache): Deleted.
1241         * css/FontLoader.h:
1242         * dom/ActiveDOMObject.cpp:
1243         (WebCore::ActiveDOMObject::canSuspendForDocumentSuspension):
1244         (WebCore::ActiveDOMObject::canSuspendForPageCache): Deleted.
1245         * dom/ActiveDOMObject.h:
1246         * dom/Document.cpp:
1247         (WebCore::Document::~Document):
1248         * dom/ScriptExecutionContext.cpp:
1249         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForTabSuspension):
1250         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache): Deleted.
1251         * dom/ScriptExecutionContext.h:
1252         * fileapi/FileReader.cpp:
1253         (WebCore::FileReader::canSuspendForDocumentSuspension):
1254         (WebCore::FileReader::canSuspendForPageCache): Deleted.
1255         * fileapi/FileReader.h:
1256         * history/CachedFrame.cpp:
1257         (WebCore::CachedFrame::CachedFrame):
1258         * history/PageCache.cpp:
1259         (WebCore::canCacheFrame):
1260         * html/HTMLMarqueeElement.cpp:
1261         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension):
1262         (WebCore::HTMLMarqueeElement::canSuspendForPageCache): Deleted.
1263         * html/HTMLMarqueeElement.h:
1264         * html/HTMLMediaElement.cpp:
1265         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension):
1266         (WebCore::HTMLMediaElement::canSuspendForPageCache): Deleted.
1267         * html/HTMLMediaElement.h:
1268         * html/HTMLSourceElement.cpp:
1269         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension):
1270         (WebCore::HTMLSourceElement::canSuspendForPageCache): Deleted.
1271         * html/HTMLSourceElement.h:
1272         * html/PublicURLManager.cpp:
1273         (WebCore::PublicURLManager::canSuspendForDocumentSuspension):
1274         (WebCore::PublicURLManager::canSuspendForPageCache): Deleted.
1275         * html/PublicURLManager.h:
1276         * html/canvas/WebGLRenderingContextBase.cpp:
1277         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension):
1278         (WebCore::WebGLRenderingContextBase::canSuspendForPageCache): Deleted.
1279         * html/canvas/WebGLRenderingContextBase.h:
1280         * loader/FrameLoader.cpp:
1281         (WebCore::FrameLoader::clear):
1282         (WebCore::FrameLoader::open):
1283         * loader/appcache/DOMApplicationCache.cpp:
1284         (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension):
1285         (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension):
1286         (WebCore::DOMApplicationCache::disconnectFrameForPageCache): Deleted.
1287         (WebCore::DOMApplicationCache::reconnectFrameFromPageCache): Deleted.
1288         * loader/appcache/DOMApplicationCache.h:
1289         * page/DOMWindow.cpp:
1290         (WebCore::DOMWindow::DOMWindow):
1291         (WebCore::DOMWindow::~DOMWindow):
1292         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
1293         (WebCore::DOMWindow::suspendForDocumentSuspension):
1294         (WebCore::DOMWindow::resumeFromDocumentSuspension):
1295         (WebCore::DOMWindow::disconnectDOMWindowProperties):
1296         (WebCore::DOMWindow::reconnectDOMWindowProperties):
1297         (WebCore::DOMWindow::resetUnlessSuspendedForPageCache): Deleted.
1298         (WebCore::DOMWindow::suspendForPageCache): Deleted.
1299         (WebCore::DOMWindow::resumeFromPageCache): Deleted.
1300         * page/DOMWindow.h:
1301         * page/DOMWindowExtension.cpp:
1302         (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension):
1303         (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension):
1304         (WebCore::DOMWindowExtension::disconnectFrameForPageCache): Deleted.
1305         (WebCore::DOMWindowExtension::reconnectFrameFromPageCache): Deleted.
1306         * page/DOMWindowExtension.h:
1307         * page/DOMWindowProperty.cpp:
1308         (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
1309         (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
1310         (WebCore::DOMWindowProperty::disconnectFrameForPageCache): Deleted.
1311         (WebCore::DOMWindowProperty::reconnectFrameFromPageCache): Deleted.
1312         * page/DOMWindowProperty.h:
1313         * page/EventSource.cpp:
1314         (WebCore::EventSource::canSuspendForDocumentSuspension):
1315         (WebCore::EventSource::canSuspendForPageCache): Deleted.
1316         * page/EventSource.h:
1317         * page/SuspendableTimer.cpp:
1318         (WebCore::SuspendableTimer::canSuspendForDocumentSuspension):
1319         (WebCore::SuspendableTimer::canSuspendForPageCache): Deleted.
1320         * page/SuspendableTimer.h:
1321         * workers/Worker.cpp:
1322         (WebCore::Worker::canSuspendForDocumentSuspension):
1323         (WebCore::Worker::canSuspendForPageCache): Deleted.
1324         * workers/Worker.h:
1325         * xml/XMLHttpRequest.cpp:
1326         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension):
1327         (WebCore::XMLHttpRequest::canSuspendForPageCache): Deleted.
1328         * xml/XMLHttpRequest.h:
1329
1330 2015-11-30  Brady Eidson  <beidson@apple.com>
1331
1332         Modern IDB: "prevunique" cursors should point at the lowest primary key that matches, not the highest.
1333         https://bugs.webkit.org/show_bug.cgi?id=151675.
1334
1335         Reviewed by Darin Adler.
1336
1337         No new tests (Covered by at least one failing test that now passes, and updates to previously incorrect tests).
1338
1339         * Modules/indexeddb/server/IndexValueEntry.cpp:
1340         (WebCore::IDBServer::IndexValueEntry::reverseBegin): If CursorDuplicity is NoDuplicates, start at the lowest
1341           entry instead of the highest.
1342         (WebCore::IDBServer::IndexValueEntry::reverseFind):
1343         * Modules/indexeddb/server/IndexValueEntry.h:
1344         
1345         * Modules/indexeddb/server/IndexValueStore.cpp:
1346         (WebCore::IDBServer::IndexValueStore::reverseFind):
1347         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
1348         (WebCore::IDBServer::IndexValueStore::Iterator::nextIndexEntry):
1349         * Modules/indexeddb/server/IndexValueStore.h:
1350         
1351         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1352         (WebCore::IDBServer::MemoryIndexCursor::MemoryIndexCursor):
1353         (WebCore::IDBServer::MemoryIndexCursor::iterate):
1354         
1355         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1356         (WebCore::IDBCursorInfo::duplicity):
1357         (WebCore::IDBCursorInfo::isDirectionNoDuplicate): Deleted.
1358         * Modules/indexeddb/shared/IDBCursorInfo.h:
1359
1360 2015-11-30  Jiewen Tan  <jiewen_tan@apple.com>
1361
1362         Null dereference loading Blink layout test http/tests/misc/detach-during-notifyDone.html
1363         https://bugs.webkit.org/show_bug.cgi?id=149309
1364         <rdar://problem/22748363>
1365
1366         Reviewed by Brent Fulgham.
1367
1368         A weird order of event execution introduced by the test case will kill the webpage in a
1369         subframe of the page while executing its |frame.loader().checkLoadCompleteForThisFrame()|.
1370         Therefore, any frames comes after the failing subframe will have no page. Check it before
1371         calling to those frames' |frame.loader().checkLoadCompleteForThisFrame()|, otherwise the
1372         assertion in |frame.loader().checkLoadCompleteForThisFrame()| will fail.
1373
1374         Test: http/tests/misc/detach-during-notifyDone.html
1375
1376         * loader/FrameLoader.cpp:
1377         (WebCore::FrameLoader::checkLoadComplete):
1378
1379 2015-11-30  Commit Queue  <commit-queue@webkit.org>
1380
1381         Unreviewed, rolling out r192819.
1382         https://bugs.webkit.org/show_bug.cgi?id=151681
1383
1384         This change broke existing layout tests on Windows (Requested
1385         by ryanhaddad on #webkit).
1386
1387         Reverted changeset:
1388
1389         "Unify font-variant-* with font-variant shorthand"
1390         https://bugs.webkit.org/show_bug.cgi?id=149773
1391         http://trac.webkit.org/changeset/192819
1392
1393 2015-11-30  Darin Adler  <darin@apple.com>
1394
1395         Use Optional instead of isNull out argument for nullable getters
1396         https://bugs.webkit.org/show_bug.cgi?id=151676
1397
1398         Reviewed by Anders Carlsson.
1399
1400         No behavior change, just cleaner code.
1401
1402         * Modules/geolocation/Coordinates.cpp:
1403         (WebCore::Coordinates::altitude): Return an Optional.
1404         (WebCore::Coordinates::altitudeAccuracy): Ditto.
1405         (WebCore::Coordinates::heading): Ditto.
1406         (WebCore::Coordinates::speed): Ditto.
1407         * Modules/geolocation/Coordinates.h: Ditto.
1408
1409         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1410         (WebCore::IDBVersionChangeEvent::create): Added. The code before was calling
1411         through to Event::create, which is clearly not what was wanted. Also removed
1412         unneeded explicit destructor.
1413         * Modules/indexeddb/IDBVersionChangeEvent.h: Changed return type of newVersion
1414         to Optional and updated for above change.
1415
1416         * Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp:
1417         (WebCore::IDBClient::IDBVersionChangeEvent::newVersion): Changed to return
1418         an Optional.
1419         * Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed unused
1420         default argument values; the event type one, at least, was clearly incorrect.
1421         Made more things private, got rid of unneeded destructor, marked class final
1422         instead of marking all functions final.
1423
1424         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp:
1425         (WebCore::LegacyVersionChangeEvent::newVersion): Same as above.
1426         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Ditto.
1427
1428         * Modules/mediastream/MediaTrackConstraints.cpp:
1429         (WebCore::MediaTrackConstraints::optional): Removed bogus bool value. If we
1430         come back to finish later we will have to implement optional return values
1431         for arrays in the JavaScript bindings generator, which should be straightforward.
1432         * Modules/mediastream/MediaTrackConstraints.h: Ditto.
1433
1434         * bindings/js/JSDOMBinding.h:
1435         (WebCore::toNullableJSNumber): Added. This function template is used for
1436         return values that are nullable numbers.
1437
1438         * bindings/scripts/CodeGeneratorGObject.pm:
1439         (GenerateFunction): Replaced some existing bogus code to handle nullables with
1440         new equally-bogus code that should be no worse and will compile.
1441
1442         * bindings/scripts/CodeGeneratorJS.pm:
1443         (GenerateImplementation): Removed old support for nullables.
1444         (NativeToJSValue): Added new support for nullable numbers.
1445
1446         * bindings/scripts/CodeGeneratorObjC.pm:
1447         (GenerateImplementation): Removed support for nullables. We almost certainly
1448         won't need it for Objective-C bindings.
1449
1450         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Updated.
1451         * bindings/scripts/test/JS/JSTestObj.cpp: Updated.
1452         * bindings/scripts/test/ObjC/DOMTestObj.mm: Updated.
1453
1454 2015-11-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1455
1456         Split platform-independent logic in AVCaptureDeviceManager out into a new class
1457         https://bugs.webkit.org/show_bug.cgi?id=151388
1458         <rdar://problem/23593980>
1459
1460         Reviewed by Eric Carlson.
1461
1462         To prepare for creating a MockCaptureDeviceManager to be able to test
1463         MediaDevices.getUserMedia, we create a platform-independent capture device manager
1464         which all platforms should extend and add platform-specific logic to.
1465
1466         The methods CaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints and
1467         CaptureDeviceManager::captureDeviceList should be overridden by each platform
1468         CaptureDeviceManager to respectively create a RealtimeMediaSource and return a list of
1469         capture devices. createMediaSourceForCaptureDeviceWithConstraints attempts to create
1470         a media source for a given device with some constraints; if the contraints cannot be
1471         satisfied, this returns null.
1472
1473         The refactored capture device manager also introduces the notion of a platform-
1474         independent capture session which may be extended by platform device managers for
1475         determining whether a given constraint name, value and media type is valid.
1476
1477         A platform-independent CaptureDeviceInfo now represents either the video or audio
1478         component of a capture device, but not both at once. This means a capture device that
1479         supports both video and audio will emit two separate capture devices.
1480
1481         No new tests, since there should be no behavior change.
1482
1483         * Modules/mediastream/CaptureDeviceInfo.h: Added.
1484         (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
1485         (WebCore::CaptureSessionInfo::supportsVideoSize):
1486         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
1487         * Modules/mediastream/CaptureDeviceManager.cpp: Added.
1488         (CaptureDeviceManager::~CaptureDeviceManager):
1489         (CaptureDeviceManager::getSourcesInfo):
1490         (CaptureDeviceManager::captureDeviceFromDeviceID):
1491         (CaptureDeviceManager::verifyConstraintsForMediaType):
1492         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
1493         (CaptureDeviceManager::sourceWithUID):
1494         (CaptureDeviceManager::bestDeviceForFacingMode):
1495         (facingModeFromString):
1496         (CaptureDeviceManager::sessionSupportsConstraint):
1497         (CaptureDeviceManager::isSupportedFrameRate):
1498         * Modules/mediastream/CaptureDeviceManager.h: Added.
1499         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList):
1500         (WebCore::CaptureDeviceManager::defaultCaptureSession):
1501         * WebCore.xcodeproj/project.pbxproj:
1502         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp: Added.
1503         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
1504         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName):
1505         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
1506         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
1507         * platform/mediastream/mac/AVCaptureDeviceManager.h:
1508         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1509         (WebCore::AVCaptureSessionInfo::AVCaptureSessionInfo):
1510         (WebCore::AVCaptureSessionInfo::supportsVideoSize):
1511         (WebCore::AVCaptureSessionInfo::bestSessionPresetForVideoDimensions):
1512         (WebCore::AVCaptureDeviceManager::captureDeviceList):
1513         (WebCore::shouldConsiderDeviceInDeviceList):
1514         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList):
1515         (WebCore::AVCaptureDeviceManager::AVCaptureDeviceManager):
1516         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
1517         (WebCore::AVCaptureDeviceManager::sourceWithUID):
1518         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
1519         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType):
1520         (WebCore::AVCaptureDeviceManager::defaultCaptureSession):
1521         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint):
1522         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
1523         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
1524         (WebCore::AVCaptureDeviceManager::isSupportedFrameRate):
1525         (WebCore::CaptureDevice:::m_enabled): Deleted.
1526         (WebCore::captureDeviceList): Deleted.
1527         (WebCore::captureDeviceFromDeviceID): Deleted.
1528         (WebCore::refreshCaptureDeviceList): Deleted.
1529         (WebCore::AVCaptureDeviceManager::bestSessionPresetForVideoSize): Deleted.
1530         (WebCore::AVCaptureDeviceManager::deviceSupportsFacingMode): Deleted.
1531         (WebCore::AVCaptureDeviceManager::bestDeviceForFacingMode): Deleted.
1532         (WebCore::AVCaptureDeviceManager::isValidConstraint): Deleted.
1533         (WebCore::AVCaptureDeviceManager::validConstraintNames): Deleted.
1534         (WebCore::AVCaptureDeviceManager::validFacingModes): Deleted.
1535         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1536         (WebCore::AVVideoCaptureSource::applyConstraints):
1537         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1538         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
1539         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
1540
1541 2015-11-30  Brady Eidson  <beidson@apple.com>
1542
1543         Modern IDB: Set the correct source on the IDBRequest for cursor updates
1544         https://bugs.webkit.org/show_bug.cgi?id=151665
1545
1546         Reviewed by Andy Estes.
1547
1548         No new tests (At least one existing failing test now passes).
1549
1550         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1551         (WebCore::IDBClient::IDBCursor::update):
1552         
1553         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1554         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate):
1555         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
1556         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1557         
1558         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1559         (WebCore::IDBClient::IDBRequest::IDBRequest):
1560         (WebCore::IDBClient::IDBRequest::setSource):
1561         * Modules/indexeddb/client/IDBRequestImpl.h:
1562
1563 2015-11-30  Tim Horton  <timothy_horton@apple.com>
1564
1565         Get rid of the legacy TextIndicatorWindow style
1566         https://bugs.webkit.org/show_bug.cgi?id=151674
1567
1568         Reviewed by Anders Carlsson.
1569
1570         * page/TextIndicator.h:
1571         * page/mac/TextIndicatorWindow.mm:
1572         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Deleted.
1573
1574 2015-11-30  Brady Eidson  <beidson@apple.com>
1575
1576         Modern IDB: Correct handling of cursors finishing iteration.
1577         https://bugs.webkit.org/show_bug.cgi?id=151664
1578
1579         Reviewed by Andy Estes.
1580
1581         No new tests (At least one previously failing test now passes).
1582
1583         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1584         (WebCore::IDBClient::IDBCursor::setGetResult):
1585         
1586         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1587         (WebCore::IDBClient::IDBObjectStore::putOrAdd):
1588
1589 2015-11-30  Myles C. Maxfield  <mmaxfield@apple.com>
1590
1591         Unify font-variant-* with font-variant shorthand
1592         https://bugs.webkit.org/show_bug.cgi?id=149773
1593
1594         Reviewed by Darin Adler.
1595
1596         This patch makes font-variant a shorthand for the following properties:
1597         font-variant-ligatures
1598         font-variant-position
1599         font-variant-caps
1600         font-variant-numeric
1601         font-variant-alternates
1602         font-variant-east-asian
1603
1604         This is consistent with the CSS Fonts Level 3 spec.
1605
1606         This patch also migrates the "font" longhand to use the font-variant-caps
1607         property.
1608
1609         Test: fast/text/font-variant-shorthand.html
1610
1611         * css/CSSComputedStyleDeclaration.cpp:
1612         (WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
1613         (WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
1614         font-variant computed style.
1615         (WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
1616         the font shorthand.
1617         * css/CSSFontSelector.cpp:
1618         (WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
1619         of the new shorthand property).
1620         * css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
1621         (WebCore::CSSParser::parseValue):
1622         (WebCore::CSSParser::parseFont):
1623         (WebCore::CSSParser::parseSystemFont):
1624         (WebCore::CSSParser::parseFontVariantLigatures):
1625         (WebCore::CSSParser::parseFontVariantNumeric):
1626         (WebCore::CSSParser::parseFontVariantEastAsian):
1627         (WebCore::CSSParser::parseFontVariant):
1628         (WebCore::isValidKeywordPropertyAndValue): Deleted.
1629         (WebCore::isKeywordPropertyID): Deleted.
1630         * css/CSSParser.h:
1631         * css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
1632         * css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
1633         FontVariantEastAsian type.
1634         (WebCore::applyValueFontVariantLigatures):
1635         (WebCore::applyValueFontVariantNumeric):
1636         (WebCore::applyValueFontVariantEastAsian):
1637         * css/StyleProperties.cpp: Update to use the more specific property.
1638         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
1639         (WebCore::StyleProperties::fontValue):
1640         (WebCore::StyleProperties::asText):
1641         * css/StyleResolver.cpp: Ditto.
1642         (WebCore::StyleResolver::isValidCueStyleProperty):
1643         * editing/EditingStyle.cpp: Ditto.
1644         * editing/cocoa/HTMLConverter.mm: Ditto.
1645         (HTMLConverterCaches::propertyValueForNode):
1646         (HTMLConverter::computedAttributesForElement):
1647         * editing/ios/EditorIOS.mm: Ditto.
1648         (WebCore::Editor::removeUnchangeableStyles):
1649         * html/canvas/CanvasRenderingContext2D.cpp: Ditto.
1650         (WebCore::CanvasRenderingContext2D::font):
1651         (WebCore::CanvasRenderingContext2D::setFont):
1652         * platform/graphics/FontCache.h: Removing duplicate cache key value.
1653         (WebCore::FontDescriptionKey::makeFlagsKey):
1654         * platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
1655         (WebCore::FontCascade::glyphDataForCharacter):
1656         * platform/graphics/FontCascade.h: Ditto.
1657         (WebCore::FontCascade::isSmallCaps):
1658         * platform/graphics/FontDescription.cpp: Ditto.
1659         (WebCore::FontDescription::FontDescription):
1660         * platform/graphics/FontDescription.h: Ditto.
1661         (WebCore::FontCascadeDescription::equalForTextAutoSizing):
1662         (WebCore::FontDescription::smallCaps): Deleted.
1663         (WebCore::FontDescription::setSmallCaps): Deleted.
1664         (WebCore::FontDescription::setIsSmallCaps): Deleted.
1665         (WebCore::FontDescription::operator==): Deleted.
1666         * platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
1667         (WebCore::computeFeatureSettingsFromVariants):
1668         * platform/text/TextFlags.h: Ditto.
1669         (WebCore::FontVariantSettings::operator==):
1670         * rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
1671         (WebCore::RenderText::widthFromCache):
1672
1673 2015-11-30  Brady Eidson  <beidson@apple.com>
1674
1675         Modern IDB: After versionchange transactions abort, fire onerror on the original IDBOpenDBRequest.
1676         https://bugs.webkit.org/show_bug.cgi?id=151648
1677
1678         Reviewed by Andy Estes.
1679
1680         No new tests. Covered by at least one existing failing test which now passes, and many
1681         other tests updated to fix their incorrect behavior.
1682
1683         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
1684         (WebCore::IDBClient::IDBDatabase::transaction):
1685         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
1686         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
1687         
1688         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1689         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):
1690         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1691         
1692         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1693         (WebCore::IDBClient::IDBTransaction::notifyDidAbort):
1694         (WebCore::IDBClient::IDBTransaction::didAbort):
1695         (WebCore::IDBClient::IDBTransaction::didCommit):
1696         * Modules/indexeddb/client/IDBTransactionImpl.h:
1697
1698 2015-11-30  Chris Dumez  <cdumez@apple.com>
1699
1700         location.origin is undefined in a web worker
1701         https://bugs.webkit.org/show_bug.cgi?id=151614
1702
1703         Reviewed by Darin Adler.
1704
1705         Expose location.origin to web workers, as per:
1706         https://html.spec.whatwg.org/multipage/workers.html#workerlocation
1707
1708         This behavior is consistent with the behavior of Firefox and Chrome.
1709
1710         Test: fast/workers/worker-location.html
1711
1712         * workers/WorkerLocation.cpp:
1713         (WebCore::WorkerLocation::origin):
1714         * workers/WorkerLocation.h:
1715         * workers/WorkerLocation.idl:
1716
1717 2015-11-30  Brady Eidson  <beidson@apple.com>
1718
1719         Modern IDB: Support updating cursor values when the object store uses inline keys.
1720         https://bugs.webkit.org/show_bug.cgi?id=151647
1721
1722         Reviewed by Andy Estes.
1723
1724         No new tests (At least two previously failing tests now pass and are unskipped).
1725
1726         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1727         (WebCore::IDBClient::IDBCursor::update): Use putForCursorUpdate() instead of put()
1728         
1729         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1730         (WebCore::IDBClient::IDBObjectStore::add):
1731         (WebCore::IDBClient::IDBObjectStore::put):
1732         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the flag to skip the inline-key check.
1733         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add a flag to skip the inline-key check.
1734         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
1735
1736 2015-11-30  Brady Eidson  <beidson@apple.com>
1737
1738         Modern IDB: Resolve flaky GC-vs-wrapper issue with IDBOpenDBRequest.
1739         https://bugs.webkit.org/show_bug.cgi?id=151645
1740
1741         Reviewed by Andy Estes.
1742
1743         No new tests (Resolves flakiness with hundreds of existing IDB tests).
1744
1745         Do to improper management of the m_hasPendingActivity flag on IDBRequestImpl,
1746         the request wrapper for an IDBOpenDBRequest might be garbage collected in between the
1747         onUpgradeNeeded event and onSuccess event.
1748         
1749         This manifested as flakiness in many tests, some more than others.
1750         
1751         I tried to write a targeted 100% reproducible case manually forcing GC, but could not get
1752         the timing right.
1753         
1754         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1755         (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
1756         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1757         
1758         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1759         (WebCore::IDBClient::IDBRequest::dispatchEvent):
1760         (WebCore::IDBClient::IDBRequest::willIterateCursor):
1761         * Modules/indexeddb/client/IDBRequestImpl.h:
1762         (WebCore::IDBClient::IDBRequest::isOpenDBRequest):
1763
1764 2015-11-30  Per Arne Vollan  <peavo@outlook.com>
1765
1766         [WinCairo][MediaFoundation] Implement seek.
1767         https://bugs.webkit.org/show_bug.cgi?id=151609
1768
1769         Reviewed by Alex Christensen.
1770
1771         The methods maxTimeSeekable() and buffered() needs to be implemented.
1772
1773         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1774         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
1775         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
1776         (WebCore::MediaPlayerPrivateMediaFoundation::readyState):
1777         (WebCore::MediaPlayerPrivateMediaFoundation::maxTimeSeekable):
1778         (WebCore::MediaPlayerPrivateMediaFoundation::buffered):
1779         (WebCore::MediaPlayerPrivateMediaFoundation::didLoadingProgress):
1780         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::currentTime):
1781         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::isActive):
1782         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1783         (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::maxTimeLoaded):
1784
1785 2015-11-30  Brady Eidson  <beidson@apple.com>
1786
1787         Modern IDB: openCursor() fix resulting in at least 4 more passing tests.
1788         https://bugs.webkit.org/show_bug.cgi?id=151630
1789
1790         Reviewed by Andy Estes.
1791
1792         No new tests (At least 4 failing tests now pass, and 9 other incorrect tests updated).
1793
1794         * Modules/indexeddb/IDBGetResult.cpp:
1795         (WebCore::IDBGetResult::isolatedCopy):
1796         * Modules/indexeddb/IDBGetResult.h:
1797         (WebCore::IDBGetResult::IDBGetResult):
1798         (WebCore::IDBGetResult::isDefined):
1799
1800         * Modules/indexeddb/client/IDBRequestImpl.cpp:
1801         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): If the IDBGetResult is undefined,
1802           do not expose the cursor as the result property of the IDBRequest.
1803
1804 2015-11-30  Brady Eidson  <beidson@apple.com>
1805
1806         Modern IDB: Support keyPath injection into object store records.
1807         https://bugs.webkit.org/show_bug.cgi?id=151640
1808
1809         Reviewed by Andy Estes.
1810
1811         No new tests (At least one existing failure now passes and is unskipped,
1812         while many other existing failures are now closer to passing).
1813
1814         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1815         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Use the new UniqueIDBDatabase VM/ExecState.
1816         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto
1817         (WebCore::IDBServer::indexVM): Deleted.
1818         (WebCore::IDBServer::indexGlobalExec): Deleted.
1819         
1820         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1821         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
1822         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
1823         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): If appropriate, inject the key that will be used into
1824           the value before storing the record.
1825         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1826
1827         Add modern JSValue/ExecState& version of some binding utilities, for use today and in preparation of getting 
1828         rid of the DOMRequestState and Deprecated::ScriptValue versions later:
1829         * bindings/js/IDBBindingUtilities.cpp:
1830         (WebCore::idbKeyToJSValue):
1831         (WebCore::injectIDBKeyIntoScriptValue):
1832         (WebCore::deserializeIDBValueData):
1833         (WebCore::deserializeIDBValueDataToJSValue):
1834         * bindings/js/IDBBindingUtilities.h:
1835
1836 2015-11-25  Andy Estes  <aestes@apple.com>
1837
1838         [Content Filtering] Avoid creating a ContentFilter when loading the empty document
1839         https://bugs.webkit.org/show_bug.cgi?id=151615
1840
1841         Reviewed by Daniel Bates.
1842
1843         It's expensive to create the first ContentFilter since two frameworks must be soft-linked. There's no reason to
1844         pay this cost if we're just loading the empty document.
1845
1846         No new tests. It's not possible to write a test that would fail without this change since ContentFilter is not
1847         notified of empty document loads.
1848
1849         * loader/DocumentLoader.cpp:
1850         (WebCore::DocumentLoader::startLoadingMainResource): Don't initialize m_contentFilter until we know we aren't
1851         loading the empty document.
1852         (WebCore::DocumentLoader::DocumentLoader):
1853
1854 2015-11-29  Antoine Quint  <graouts@apple.com>
1855
1856         Browser does not fall back to SVG attribute value when CSS style value is invalid or not supported
1857         https://bugs.webkit.org/show_bug.cgi?id=147932
1858
1859         Reviewed by Dean Jackson.
1860
1861         Instead of returning an SVGPaint object of type SVG_PAINTTYPE_UNKNOWN when we encounter an SVG paint
1862         value that cannot be parsed, we now return `nullptr` which will cause that value to be ignored and
1863         let another paint value in the cascade be used instead. This is the same approach used for SVGColor.
1864         Since we're removing the only call site for `SVGPaint::createUnknown()`, we remove that function entirely.
1865
1866         Tests: svg/css/invalid-color-cascade.svg
1867                svg/css/invalid-paint-cascade.svg
1868
1869         * css/SVGCSSParser.cpp:
1870         (WebCore::CSSParser::parseSVGPaint):
1871         * svg/SVGPaint.h:
1872         (WebCore::SVGPaint::createUnknown): Deleted.
1873
1874 2015-11-29  Simon Fraser  <simon.fraser@apple.com>
1875
1876         Use SVGTransform::SVGTransformType instead of an unsigned short
1877         https://bugs.webkit.org/show_bug.cgi?id=151637
1878
1879         Reviewed by Brady Eidson.
1880
1881         Make 'type' more strongly typed.
1882
1883         * svg/SVGTransformable.cpp:
1884         (WebCore::SVGTransformable::parseTransformValue):
1885         (WebCore::parseAndSkipType):
1886         (WebCore::SVGTransformable::parseTransformType):
1887         (WebCore::SVGTransformable::parseTransformAttribute):
1888         * svg/SVGTransformable.h:
1889
1890 2015-11-27  Brady Eidson  <beidson@apple.com>
1891
1892         Modern IDB: Class-ify IDBGetResult making it impossible to get the data members wrong.
1893         https://bugs.webkit.org/show_bug.cgi?id=151627
1894
1895         Reviewed by Alexey Proskuryakov.
1896
1897         No new tests (No change in behavior).
1898
1899         * CMakeLists.txt:
1900         * WebCore.xcodeproj/project.pbxproj:
1901
1902         * Modules/indexeddb/IDBGetResult.cpp: Added.
1903         (WebCore::IDBGetResult::dataFromBuffer):
1904         (WebCore::IDBGetResult::isolatedCopy):
1905         * Modules/indexeddb/IDBGetResult.h:
1906         (WebCore::IDBGetResult::IDBGetResult):
1907         (WebCore::IDBGetResult::valueBuffer):
1908         (WebCore::IDBGetResult::keyData):
1909         (WebCore::IDBGetResult::primaryKeyData):
1910         (WebCore::IDBGetResult::keyPath):
1911         (WebCore::IDBGetResult::setValueBuffer):
1912         (WebCore::IDBGetResult::setKeyData):
1913         (WebCore::IDBGetResult::setPrimaryKeyData):
1914         (WebCore::IDBGetResult::setKeyPath):
1915         (WebCore::IDBGetResult::dataFromBuffer): Deleted.
1916         (WebCore::IDBGetResult::isolatedCopy): Deleted.
1917
1918         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1919         (WebCore::IDBClient::IDBCursor::setGetResult):
1920         * Modules/indexeddb/client/IDBCursorImpl.h:
1921
1922         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
1923         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
1924
1925         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
1926         (WebCore::GetOperation::perform):
1927
1928         * Modules/indexeddb/server/IDBBackingStore.h:
1929
1930         * Modules/indexeddb/server/MemoryCursor.h:
1931
1932         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
1933         (WebCore::IDBServer::MemoryIndexCursor::currentData):
1934
1935         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1936         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
1937
1938         * platform/CrossThreadCopier.h:
1939
1940 2015-11-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1941
1942         [GTK] Do not use the WebCore garbage collector timer
1943         https://bugs.webkit.org/show_bug.cgi?id=151623
1944
1945         Reviewed by Martin Robinson.
1946
1947         Now that garbage collector timers have been implemented in
1948         JavaScriptCore for glib, we don't need to use another Timer in WebCore.
1949
1950         * bindings/js/GCController.cpp:
1951         (WebCore::GCController::garbageCollectSoon):
1952         (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
1953
1954 2015-11-18  Andy Estes  <aestes@apple.com>
1955
1956         [Content Filtering] Crash in DocumentLoader::notifyFinished() when allowing a media document to load
1957         https://bugs.webkit.org/show_bug.cgi?id=151433
1958         rdar://problem/23506594
1959
1960         Reviewed by Alexey Proskuryakov.
1961
1962         When the main resource of a media document commits, WebKit cancels its load since the plug-in or media engine
1963         will do its own loading. If content filtering is enabled, and the filter waits allow the load until the entire
1964         resource is downloaded, then ContentFilter will attempt to call DocumentLoader::notifyFinished() immediately
1965         after delivering the buffered resource data to DocumentLoader. However, delivering the data will have nulled out
1966         DocumentLoader's m_mainResource when the load was cancelled, leading to a crash in notifyFinished().
1967
1968         To resolve this, add a new Stopped state to ContentFilter. Set this state if DocumentLoader clears its main
1969         resource or detaches from its frame. If ContentFilter is in the Stopped state after calling
1970         DocumentLoader::dataReceived(), do not proceed to call DocumentLoader::notifyFinished().
1971
1972         Test: contentfiltering/allow-media-document.html
1973
1974         * loader/ContentFilter.cpp:
1975         (WebCore::ContentFilter::stopFilteringMainResource): Set m_state to Stopped. If m_mainResource is non-null,
1976         removed ContentFilter as a client and set m_mainResource to null.
1977         (WebCore::ContentFilter::notifyFinished): Stopped calling DocumentLoader::notifyFinished() if m_state is Stopped
1978         after calling DocumentLoader::dataReceived().
1979         * loader/ContentFilter.h:
1980         * loader/DocumentLoader.cpp:
1981         (WebCore::DocumentLoader::detachFromFrame): Called ContentFilter::stopFilteringMainResource() instead of setting
1982         m_contentFilter to null.
1983         (WebCore::DocumentLoader::clearMainResource): Ditto.
1984
1985 2015-11-25  Pranjal Jumde  <pjumde@apple.com>
1986
1987         Checks for buffer-overflows when reading characters from textRun
1988         https://bugs.webkit.org/show_bug.cgi?id=151055
1989         <rdar://problem/23251789>
1990
1991         Reviewed by Myles C. Maxfield.
1992
1993         Prevents an off by one error when adding the last font data to the GlyphBuffer.
1994
1995         * Source/WebCore/platform/graphics/WidthIterator.cpp:
1996         * Source/WebCore/platform/graphics/FontCascade.cpp:
1997
1998 2015-11-24  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1999
2000         [Streams API] Implement pipeTo method in readable Stream
2001         https://bugs.webkit.org/show_bug.cgi?id=151588
2002
2003         Reviewed by Darin Adler.
2004
2005         Implemented pipeTo method according to the reference implementation in the spec as the spec is not written
2006         yet. It can be found at https://github.com/whatwg/streams/blob/632b26a05f3106650b1ec91239ad5b012e6c64af/reference-implementation/lib/readable-stream.js#L75.
2007
2008         Tests: streams/pipe-to.html
2009                streams/reference-implementation/brand-checks.html
2010                streams/reference-implementation/pipe-through.html
2011                streams/reference-implementation/pipe-to.html
2012                streams/reference-implementation/pipe-to-options.html
2013                streams/reference-implementation/readable-stream-templated
2014
2015         * Modules/streams/ReadableStream.js:
2016         (doPipe): Internal function of pipeTo.
2017         (closeDest): Internal function of pipeTo.
2018         (abortDest): Internal function of pipeTo.
2019         (pipeTo): Implemented as per spec with some other internal functions as helpers.
2020
2021 2015-11-24  Antti Koivisto  <antti@apple.com>
2022
2023         REGRESSION (r190983): Non-element, non-text nodes should not be distributed to slots
2024         https://bugs.webkit.org/show_bug.cgi?id=151566
2025         rdar://problem/23430177
2026
2027         Reviewed by Zalan Bujtas.
2028
2029         We don't invalidate slot assignments except for text or element children. Fix by not
2030         not assigning other nodes to slots as it is not useful.
2031
2032         Test: fast/html/details-comment-crash.html
2033
2034         * dom/SlotAssignment.cpp:
2035         (WebCore::slotNameFromSlotAttribute):
2036         (WebCore::SlotAssignment::findAssignedSlot):
2037         (WebCore::SlotAssignment::assignSlots):
2038
2039 2015-11-23  David Kilzer  <ddkilzer@apple.com>
2040
2041         Hardening against CSSSelector double frees
2042         <http://webkit.org/b/56124>
2043         <rdar://problem/9119036>
2044
2045         Reviewed by Antti Koivisto.
2046
2047         Add some security assertions to catch this issue if it ever
2048         happens in Debug builds, and make changes in
2049         CSSSelector::~CSSSelector() and
2050         CSSSelectorList::deleteSelectors() to prevent obvious issues if
2051         they're ever called twice in Release builds.
2052
2053         No new tests because we don't know how to reproduce this.
2054
2055         * css/CSSSelector.cpp:
2056         (WebCore::CSSSelector::CSSSelector): Initialize
2057         m_destructorHasBeenCalled.
2058         * css/CSSSelector.h:
2059         (WebCore::CSSSelector::m_destructorHasBeenCalled): Add bitfield.
2060         (WebCore::CSSSelector::CSSSelector): Initialize
2061         m_destructorHasBeenCalled.
2062         (WebCore::CSSSelector::~CSSSelector): Add security assertion
2063         that this is never called twice.  Clear out any fields that
2064         would have caused us to dereference an object twice.
2065
2066         * css/CSSSelectorList.cpp:
2067         (WebCore::CSSSelectorList::deleteSelectors): Clear
2068         m_selectorArray when freeing the memory to which it was
2069         pointing.  This prevents re-entrancy issues or calling this
2070         method twice on the same thread.  Also restructure the for()
2071         loop to prevent calling CSSSelector::isLastInSelectorList()
2072         after CSSSelector::~CSSSelector() has been called (via CRBug
2073         241892).
2074
2075 2015-11-23  Brian Burg  <bburg@apple.com>
2076
2077         Web Inspector: inspector settings should not be shared between different inspection levels
2078         https://bugs.webkit.org/show_bug.cgi?id=151151
2079
2080         Reviewed by Timothy Hatcher.
2081
2082         InspectorController and InspectorFrontendClient should know how to compute their
2083         inspection levels, so that this level can be exposed to the Inspector frontend for
2084         preference disambiguation by inspection level.
2085
2086          - A Page with normal web content has an inspection level of 0.
2087          - The first Web Inspector has an inspection level of 1.
2088          - The second Web Inspector that inspects the Inspector has an inspection level of 2.
2089          - And so forth...
2090
2091         For local frontend clients (WK1 and the ProtocolTestStub), the inspection level of
2092         a Page computed as follows:
2093
2094         - If the page's inspector controller has no frontend client, then the Page
2095         is normal web content (level 0).
2096         - If the page's inspector controller has a frontend client, ask for its inspection level.
2097         A frontend client looks at the inspection level reported by inspected page's inspector
2098         controller and increments by one to account for the crossed inspection boundary.
2099
2100         No new tests, this is blocked by test infrastructure fixes (https://webkit.org/b/151573).
2101
2102         * inspector/InspectorController.cpp:
2103         (WebCore::InspectorController::inspectionLevel): Added.
2104         (WebCore::InspectorController::hasInspectorFrontendClient): Deleted.
2105         * inspector/InspectorController.h:
2106         * inspector/InspectorFrontendClient.h:
2107         * inspector/InspectorFrontendClientLocal.cpp:
2108         (WebCore::InspectorFrontendClientLocal::canAttachWindow): Check inspectionLevel().
2109         (WebCore::InspectorFrontendClientLocal::inspectionLevel): Added.
2110         * inspector/InspectorFrontendClientLocal.h:
2111         * inspector/InspectorFrontendHost.cpp:
2112         (WebCore::InspectorFrontendHost::inspectionLevel): Added.
2113         * inspector/InspectorFrontendHost.h:
2114         * inspector/InspectorFrontendHost.idl:
2115         * page/ContextMenuController.cpp:
2116         (WebCore::ContextMenuController::populate): Check inspectionLevel().
2117
2118 2015-11-20  Brian Burg  <bburg@apple.com>
2119
2120         Web Inspector: RemoteInspector should track targets and connections for remote automation
2121         https://bugs.webkit.org/show_bug.cgi?id=151042
2122
2123         Reviewed by Joseph Pecoraro.
2124
2125         Use the new RemoteControllableTarget API method names.
2126
2127         No new tests, no behavior change.
2128
2129         * page/PageDebuggable.cpp:
2130         (WebCore::PageDebuggable::connect):
2131         (WebCore::PageDebuggable::dispatchMessageFromRemote):
2132         (WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend): Deleted.
2133         * page/PageDebuggable.h:
2134
2135 2015-11-23  Brady Eidson  <beidson@apple.com>
2136
2137         Modern IDB: Unskip all indexeddb/mozilla tests that pass.
2138         https://bugs.webkit.org/show_bug.cgi?id=151568
2139         
2140         Reviewed by Alex Christensen.
2141
2142         No new tests (Lots of skipped existing tests now pass).
2143
2144         * Modules/indexeddb/shared/IDBError.h:
2145
2146 2015-11-23  Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au>
2147
2148         Add WebCore namespace for generated bindings for supplemental method calls
2149         https://bugs.webkit.org/show_bug.cgi?id=151431
2150
2151         Reviewed by Alex Christensen.
2152
2153         Address build failures for generated supplemental method calls which are in the WebCore namespace. 
2154         The bindings are outside the WebCore namespace - so add WebCore namespace specifier where required.
2155
2156         * bindings/scripts/CodeGeneratorJS.pm:
2157         (GenerateHeader):
2158         (GenerateImplementation):
2159         (GenerateParametersCheck):
2160         * bindings/scripts/CodeGeneratorObjC.pm:
2161         (GenerateImplementation):
2162         * bindings/scripts/test/JS/JSTestInterface.cpp:
2163         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
2164         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
2165         (WebCore::jsTestInterfaceSupplementalStr1):
2166         (WebCore::jsTestInterfaceSupplementalStr2):
2167         (WebCore::jsTestInterfaceSupplementalNode):
2168         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2169         (WebCore::setJSTestInterfaceSupplementalStr2):
2170         (WebCore::setJSTestInterfaceSupplementalNode):
2171         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
2172         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2173         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
2174         * bindings/scripts/test/ObjC/DOMTestInterface.mm:
2175         (-[DOMTestInterface supplementalStr1]):
2176         (-[DOMTestInterface supplementalStr2]):
2177         (-[DOMTestInterface setSupplementalStr2:]):
2178         (-[DOMTestInterface supplementalStr3]):
2179         (-[DOMTestInterface setSupplementalStr3:]):
2180         (-[DOMTestInterface supplementalNode]):
2181         (-[DOMTestInterface setSupplementalNode:]):
2182         (-[DOMTestInterface builtinAttribute]):
2183         (-[DOMTestInterface setBuiltinAttribute:]):
2184         (-[DOMTestInterface supplementalMethod1]):
2185         (-[DOMTestInterface supplementalMethod2:objArg:]):
2186         (-[DOMTestInterface supplementalMethod3]):
2187         (-[DOMTestInterface supplementalMethod4]):
2188         (-[DOMTestInterface builtinFunction]):
2189
2190 2015-11-23  Brady Eidson  <beidson@apple.com>
2191
2192         Modern IDB: When a transaction is aborted, call onerror handlers for all in-progress requests.
2193         https://bugs.webkit.org/show_bug.cgi?id=151550
2194
2195         Reviewed by Alex Christensen.
2196
2197         Test: storage/indexeddb/modern/abort-requests-cancelled.html
2198               storage/indexeddb/modern/idbtransaction-objectstore-failures.html (with changes)
2199               storage/indexeddb/modern/index-5.html (with changes)
2200               Various (currently skipped) legacy IDB tests.
2201
2202         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2203         (WebCore::IDBClient::IDBDatabase::transaction):
2204         (WebCore::IDBClient::IDBDatabase::startVersionChangeTransaction):
2205         (WebCore::IDBClient::IDBDatabase::didStartTransaction):
2206         (WebCore::IDBClient::IDBDatabase::willCommitTransaction):
2207         (WebCore::IDBClient::IDBDatabase::didCommitTransaction):
2208         (WebCore::IDBClient::IDBDatabase::willAbortTransaction):
2209         (WebCore::IDBClient::IDBDatabase::didAbortTransaction):
2210         (WebCore::IDBClient::IDBDatabase::didCommitOrAbortTransaction):
2211         
2212         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2213         (WebCore::IDBClient::IDBTransaction::abort):
2214         (WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):
2215         (WebCore::IDBClient::IDBTransaction::didCreateObjectStoreOnServer):
2216         (WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
2217         (WebCore::IDBClient::IDBTransaction::didGetRecordOnServer):
2218         (WebCore::IDBClient::IDBTransaction::didDeleteObjectStoreOnServer):
2219         (WebCore::IDBClient::IDBTransaction::didDeleteIndexOnServer):
2220         (WebCore::IDBClient::IDBTransaction::immediateAbort): Deleted.
2221         (WebCore::IDBClient::IDBTransaction::abortOnServer): Deleted.
2222         * Modules/indexeddb/client/IDBTransactionImpl.h:
2223         
2224         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2225         (WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
2226         (WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
2227         
2228         * Modules/indexeddb/shared/IDBError.cpp:
2229         (WebCore::idbErrorName):
2230         (WebCore::idbErrorDescription):
2231         * Modules/indexeddb/shared/IDBError.h:
2232         
2233         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2234         (WebCore::IDBResourceIdentifier::loggingString):
2235         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2236
2237 2015-11-23  Brady Eidson  <beidson@apple.com>
2238
2239         Modern IDB: Unskip storage/indexeddb/mozilla/global-data.html.
2240         https://bugs.webkit.org/show_bug.cgi?id=151557
2241
2242         Reviewed by Alex Christensen.
2243
2244         No new tests (Unskipping existing test storage/indexeddb/mozilla/global-data.html).
2245
2246         - Reworking some invalid ASSERTS
2247         - Actually opening pending open-database-requests after a version change transaction completes
2248         - Allow starting new transactions when the version change transaction has *started* finishing, 
2249           but before it finishes finishing.
2250
2251         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2252         (WebCore::IDBClient::IDBDatabase::transaction):
2253         
2254         * Modules/indexeddb/client/IDBTransactionImpl.h:
2255         
2256         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2257         (WebCore::IDBServer::MemoryObjectStore::~MemoryObjectStore):
2258         
2259         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2260         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded): Deleted.
2261         
2262         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2263         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
2264         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
2265         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
2266         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2267
2268 2015-11-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2269
2270         Remove DOMPromiseWithCallback
2271         https://bugs.webkit.org/show_bug.cgi?id=151565
2272
2273         Reviewed by Eric Carlson.
2274
2275         DOMPromiseWithCallback is no longer used as WebCore JS built-ins are used to the cases where DOMPromiseWithCallback made sense.
2276
2277         No change in behavior.
2278
2279         * Modules/mediastream/MediaDevices.h: Moved from DOMPromiseWithCallback to DOMPromise since the API is now called by JS built-ins.
2280         * bindings/js/JSDOMPromise.h:
2281         (WebCore::DOMPromiseWithCallback::DOMPromiseWithCallback): Deleted.
2282         (WebCore::DOMPromiseIteratorWithCallback::DOMPromiseIteratorWithCallback): Deleted.
2283         (WebCore::Error>::resolve): Deleted.
2284         (WebCore::Error>::reject): Deleted.
2285         (WebCore::Error>::resolveEnd): Deleted.
2286
2287 2015-11-23  Brian Burg  <bburg@apple.com>
2288
2289         Web Inspector: when inspecting the inspector, add the inspection level to the title bar
2290         https://bugs.webkit.org/show_bug.cgi?id=151555
2291
2292         Reviewed by Timothy Hatcher.
2293
2294         * English.lproj/Localizable.strings: add new localized string for alternate inspector title.
2295
2296 2015-11-23  Zan Dobersek  <zdobersek@igalia.com>
2297
2298         [GStreamer] No need to assert the pipeline's bus presence in MediaPlayerPrivateGStreamerBase dtor
2299         https://bugs.webkit.org/show_bug.cgi?id=151558
2300
2301         Reviewed by Carlos Garcia Campos.
2302
2303         In the MediaPlayerPrivateGStreamerBase destructor, there's some leftover code
2304         that acquires a reference to the GStreamer pipeline's bus object and then
2305         just asserts that it's not null. Not very useful, so remove it.
2306
2307         Also use nullptr to null out the m_player member.
2308
2309         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2310         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2311
2312 2015-11-17  Sergio Villar Senin  <svillar@igalia.com>
2313
2314         ASSERTION FAILED: freeSpace >= 0 in WebCore::RenderGrid::computeTrackSizesForDirection
2315         https://bugs.webkit.org/show_bug.cgi?id=151254
2316
2317         Reviewed by Darin Adler.
2318
2319         When in quirks mode, abnormally huge margins could lead to
2320         negative computations of available logical sizes. We could add
2321         an !document.inQuirksMode() check in the assertion but since
2322         negative freeSpace values are valid (i.e. the condition is not
2323         really part of the contract and everything will work as
2324         expected) I've decided to simply remove it.
2325
2326         Test: fast/css-grid-layout/grid-quirks-mode-huge-margin-crash.html
2327
2328         * rendering/RenderGrid.cpp:
2329         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
2330
2331 2015-11-22  Myles C. Maxfield  <mmaxfield@apple.com>
2332
2333         Font selection should not consult font-variant property
2334         https://bugs.webkit.org/show_bug.cgi?id=151537
2335
2336         Reviewed by Simon Fraser.
2337
2338         In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
2339         font-feature-settings] do not affect font selection."
2340
2341         All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
2342         are the only one who misbehaves. This patch aligns our behavior with the other
2343         browsers.
2344
2345         Test: fast/text/font-selection-font-variant.html
2346
2347         * css/CSSFontSelector.cpp:
2348         (WebCore::computeTraitsMask): Deleted.
2349         (WebCore::compareFontFaces): Deleted.
2350         (WebCore::CSSFontSelector::getFontFace): Deleted.
2351         * css/CSSParser.cpp:
2352         (WebCore::isValidKeywordPropertyAndValue):
2353         (WebCore::isKeywordPropertyID):
2354         (WebCore::CSSParser::createFontFaceRule):
2355         (WebCore::CSSParser::CSSParser): Deleted.
2356         (WebCore::CSSParser::parseValue): Deleted.
2357         (WebCore::CSSParser::parseDeclaration): Deleted.
2358         (WebCore::CSSParser::clearProperties): Deleted.
2359         (WebCore::CSSParser::parseFontVariant): Deleted.
2360         (WebCore::CSSParser::createStyleRule): Deleted.
2361         (WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
2362         * css/CSSParser.h:
2363         * platform/graphics/FontDescription.cpp:
2364         (WebCore::FontDescription::traitsMask): Deleted.
2365         * platform/graphics/win/FontCacheWin.cpp:
2366         (WebCore::traitsInFamilyEnumProc):
2367         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2368         (WebCore::toTraitsMask):
2369         * platform/text/TextFlags.h:
2370
2371 2015-11-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2372
2373         Unreviewed, rolling out r192727.
2374
2375         It made the selections transparent again and broke
2376         /webkit2/WebKitWebView/snapshot
2377
2378         Reverted changeset:
2379
2380         "[GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor,
2381         et. al. should not clobber state of cached GtkStyleContexts"
2382         https://bugs.webkit.org/show_bug.cgi?id=151533
2383         http://trac.webkit.org/changeset/192727
2384
2385 2015-11-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2386
2387         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
2388         https://bugs.webkit.org/show_bug.cgi?id=151533
2389
2390         Reviewed by Carlos Garcia Campos.
2391
2392         platformActiveSelectionBackgroundColor(), platformInactiveSelectionBackgroundColor(), etc.
2393         are const functions intended only to return a color used for painting, but since r174929
2394         they also change the state of the cached style contexts we use for GTK_TYPE_ENTRY and
2395         GTK_TYPE_TREE_VIEW. That's wrong; those style contexts should not have any state set. This
2396         could cause theme colors returned by those GtkStyleContexts to change unexpectedly,
2397         depending on whether the state is explicitly set before each use, or whether the theme
2398         actually uses the states.
2399
2400         This didn't cause any regression only because every place using these style contexts
2401         explicitly sets the state of the style contexts before use. In fact, the GtkTreeView style
2402         context is not used anywhere else, and the GtkEntry style context is only used in
2403         paintTextField, which does set the state before use (and then reverts it using
2404         save/restore), so this cannot have broken anything in practice. But it's a landmine waiting
2405         for the next programmer to trip it.
2406
2407         Fix this with a gtk_style_context_save()/gtk_style_context_restore() pair.
2408
2409         * rendering/RenderThemeGtk.cpp:
2410         (WebCore::styleColor):
2411
2412 2015-11-21  Myles C. Maxfield  <mmaxfield@apple.com>
2413
2414         Tiny cleanup in ComplexTextController::collectComplexTextRuns()
2415         https://bugs.webkit.org/show_bug.cgi?id=151534
2416
2417         Reviewed by Zalan Bujtas.
2418
2419         The isMissingGlyph boolean is completely unnecessary. Its entire
2420         responsiblity is duplicated by the "font" pointer.
2421
2422         No new tests because there is no behavior change.
2423
2424         * platform/graphics/mac/ComplexTextController.cpp:
2425         (WebCore::ComplexTextController::collectComplexTextRuns):
2426
2427 == Rolled over to ChangeLog-2015-11-21 ==