Modern IDB: storage/indexeddb/transaction-basics.html fails.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-12-23  Brady Eidson  <beidson@apple.com>
2
3         Modern IDB: storage/indexeddb/transaction-basics.html fails.
4         https://bugs.webkit.org/show_bug.cgi?id=152481
5
6         Reviewed by Alex Christensen.
7
8         No new tests (Failing test now passes).
9
10         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
11         (WebCore::IDBClient::IDBDatabase::transaction): Include the invalid string argument
12           in the error message.
13
14 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
15
16         Use "constrainedBetween" in more places
17         https://bugs.webkit.org/show_bug.cgi?id=152543
18
19         Reviewed by Zalan Bujtas.
20
21         Replace code that contrains points via shrunkTo/expandedTo() with calls
22         to constrainedBetween(), and implement constrainedBetween() on IntPoint,
23         FloatPoint and LayoutPoint.
24
25         Convert some functions that return points to more modern syntax.
26
27         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
28         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition):
29         * page/scrolling/ScrollingTreeScrollingNode.cpp:
30         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
31         * platform/ScrollView.cpp:
32         (WebCore::ScrollView::adjustScrollPositionWithinRange):
33         * platform/graphics/FloatPoint.cpp:
34         (WebCore::FloatPoint::constrainedBetween):
35         * platform/graphics/FloatPoint.h:
36         (WebCore::FloatPoint::shrunkTo):
37         (WebCore::FloatPoint::expandedTo):
38         (WebCore::FloatPoint::transposedPoint):
39         * platform/graphics/IntPoint.cpp:
40         * platform/graphics/LayoutPoint.cpp:
41         (WebCore::LayoutPoint::constrainedBetween):
42         * platform/graphics/LayoutPoint.h:
43         (WebCore::LayoutPoint::expandedTo):
44         (WebCore::LayoutPoint::shrunkTo):
45         (WebCore::LayoutPoint::transposedPoint):
46         (WebCore::LayoutPoint::fraction):
47         (WebCore::LayoutPoint::operator FloatPoint):
48
49 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
50
51         REGRESSION (r187593): Scroll position jumps when selecting text in an iframe
52         https://bugs.webkit.org/show_bug.cgi?id=152541
53         rdar://problem/23886181
54
55         Reviewed by Tim Horton.
56         
57         r154382 added code that modifies parentLayer traversal, looking for ancestor
58         scrollable layers. However, it confusingly added another code path in which
59         the ancestor layer traversal cross a frame boundary, when RenderLayer::scrollRectToVisible()
60         already has one. I fixed this new location to adjust the rect coordinates in r187593,
61         but then code that hit both crossing points double-mapped the coordinates, causing
62         autoscroll jumping.
63         
64         Fix by reverting r154382 and r187593, going back to doing the ancestor walk in
65         one place. Re-fix r154382 by implementing RenderLayer::allowsCurrentScroll(),
66         which contains the logic for line clamp, autoscroll and ensuring that overflow:hidden
67         can be programmatically scrolled.
68         
69         Form controls are special; they can have overflow:hidden but still be user-scrollable
70         during autoscroll; this is handled via the confusingly-named canBeProgramaticallyScrolled().
71         RenderTextControlSingleLine implements this to ensure that readonly text inputs
72         autoscroll (which is exercised by a test).
73         
74         The frame-to-parent-frame rect mapping in RenderLayer::scrollRectToVisible() is
75         fixed to use the coordinate mapping functions from Widget/ScrollView, with the
76         addition of a new utility function contentsToContainingViewContents().
77         
78         A "Scrolling" logging channel is added with a few log points.
79
80         Test: fast/events/autoscroll-in-iframe-body.html
81
82         * page/scrolling/ScrollingCoordinator.cpp:
83         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
84         use contentsToContainingViewContents().
85         * platform/Logging.h:
86         * platform/ScrollView.cpp:
87         (WebCore::ScrollView::contentsToContainingViewContents):
88         * platform/ScrollView.h:
89         * platform/graphics/IntPoint.cpp:
90         (WebCore::IntPoint::constrainedBetween): New helper to constrain a point between
91         two other points.
92         * platform/graphics/IntPoint.h:
93         (WebCore::IntPoint::expandedTo):
94         (WebCore::IntPoint::shrunkTo):
95         * rendering/RenderBox.cpp:
96         * rendering/RenderLayer.cpp:
97         (WebCore::parentLayerCrossFrame):
98         (WebCore::RenderLayer::enclosingScrollableLayer):
99         (WebCore::frameElementAndViewPermitScroll):
100         (WebCore::RenderLayer::allowsCurrentScroll):
101         (WebCore::RenderLayer::scrollRectToVisible):
102         * rendering/RenderLayer.h:
103         * rendering/RenderTextControlSingleLine.h:
104
105 2015-12-22  Simon Fraser  <simon.fraser@apple.com>
106
107         Minor cleanup in RenderBox::canBeProgramaticallyScrolled()
108         https://bugs.webkit.org/show_bug.cgi?id=152515
109
110         Reviewed by Tim Horton.
111
112         Remove the scrollsOverflow() check in RenderBox::canBeProgramaticallyScrolled(),
113         since if hasScrollableOverflow is true, scrollsOverflow() must also be true.
114         
115         Factor clientWidth/Height vs. scrollWidth/Height checks into separate functions,
116         and call them from two places.
117         
118         Added a test which is not affected by this particular change, but will verify
119         that a later change doesn't break anything.
120
121         Test: fast/overflow/overflow-hidden-scroll-into-view.html
122
123         * rendering/RenderBox.cpp:
124         (WebCore::RenderBox::canBeScrolledAndHasScrollableArea):
125         (WebCore::RenderBox::canBeProgramaticallyScrolled):
126         * rendering/RenderBox.h:
127         (WebCore::RenderBox::hasHorizontalOverflow):
128         (WebCore::RenderBox::hasVerticalOverflow):
129         (WebCore::RenderBox::hasScrollableOverflowX):
130         (WebCore::RenderBox::hasScrollableOverflowY):
131
132 2015-12-23  Pranjal Jumde  <pjumde@apple.com>
133
134         Avoids stack recursion when indexed propertyNames defined using Object.defineProperty are deleted.
135         https://bugs.webkit.org/show_bug.cgi?id=149179
136         <rdar://problem/22708019>.
137
138         Reviewed by Filip Pizlo.
139
140         * runtime/JSObject.cpp:
141         (JSStorage::deletePropertyByIndex was invoking Base::deleteProperty for indexed propertyNames instead of Base::deletePropertyByIndex leading to a stack recursion)
142
143 2015-12-23  Eric Carlson  <eric.carlson@apple.com>
144
145         [MediaStream] MediaDeviceInfo.label must be empty in some situations
146         https://bugs.webkit.org/show_bug.cgi?id=152000
147
148         Reviewed by Brent Fulgham.
149
150         No new tests, updated fast/mediastream/MediaDevices-enumerateDevices.html.
151
152         * Modules/mediastream/CaptureDeviceManager.cpp:
153         (CaptureDeviceManager::getSourcesInfo): TrackSourceInfo constructor takes persistent ID.
154
155         * Modules/mediastream/MediaDevicesRequest.cpp:
156         (WebCore::MediaDevicesRequest::start): If Document had an active stream track, don't bother
157           checking for a persistent permission to access devices.
158         (WebCore::MediaDevicesRequest::didCompleteCheck): m_hasUserMediaPermission -> m_canShowLabels.
159         (WebCore::MediaDevicesRequest::getTrackSources): New, factored out of didCompleteCheck so it
160           can be called when we don't need to check permissions.
161         (WebCore::MediaDevicesRequest::didCompleteRequest): m_hasUserMediaPermission -> m_canShowLabels.
162         * Modules/mediastream/MediaDevicesRequest.h:
163
164         * Modules/mediastream/MediaStream.cpp:
165         (WebCore::MediaStream::MediaStream): Call setIsActive. Register new stream with MediaStreamRegistry.
166         (WebCore::MediaStream::~MediaStream): Unregister stream with MediaStreamRegistry.
167         (WebCore::MediaStream::setIsActive): New. Set m_isActive and call Document if stream is active.
168         (WebCore::MediaStream::scheduleActiveStateChange): Call setIsActive.
169         (WebCore::MediaStream::registry): MediaStreamRegistry::registry -> MediaStreamRegistry::shared.
170         (WebCore::mediaStreams): Deleted. Drive-by cleanup: moved list of all streams to MediaStreamRegistry.
171         (WebCore::registerMediaStream): Ditto.
172         (WebCore::unRegisterMediaStream): Ditto.
173         (WebCore::MediaStream::lookUp): Ditto.
174         (WebCore::MediaStream::setRegistry): Ditto.
175         * Modules/mediastream/MediaStream.h:
176
177         * Modules/mediastream/MediaStreamRegistry.cpp:
178         (WebCore::MediaStreamRegistry::shared): Renamed from "registry".
179         (WebCore::MediaStreamRegistry::MediaStreamRegistry):
180         (WebCore::MediaStreamRegistry::lookUp): Moved here from MediaStream.
181         (WebCore::mediaStreams): Ditto.
182         (WebCore::MediaStreamRegistry::registerStream): Ditto.
183         (WebCore::MediaStreamRegistry::unregisterStream): Ditto.
184         (WebCore::MediaStreamRegistry::registry): Deleted.
185         * Modules/mediastream/MediaStreamRegistry.h:
186
187         * dom/Document.h:
188         (WebCore::Document::setHasActiveMediaStreamTrack): New, set m_hasHadActiveMediaStreamTrack.
189         (WebCore::Document::hasHadActiveMediaStreamTrack): New, return m_hasHadActiveMediaStreamTrack.
190
191         * html/HTMLMediaElement.cpp:
192         (WebCore::HTMLMediaElement::loadResource): MediaStream::lookUp -> MediaStreamRegistry::shared().lookUp.
193
194         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
195         (WebCore::TrackSourceInfo::create): Take track persistent ID.
196         (WebCore::TrackSourceInfo::persistentId): New.
197         (WebCore::TrackSourceInfo::TrackSourceInfo): Take track persistent ID.
198
199         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
200         (WebCore::RealtimeMediaSourceCenterMac::sourceWithUID): TrackSourceInfo::create takes persistent ID.
201
202         * platform/mock/MockRealtimeMediaSource.cpp:
203         (WebCore::MockRealtimeMediaSource::trackSourceWithUID): Ditto.
204
205         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp:
206         (WebCore::RealtimeMediaSourceCenterMac::sourceWithUID): TrackSourceInfo::create takes persistent ID.
207
208 2015-12-23  Xabier Rodriguez Calvar  <calvaris@igalia.com>
209
210         [Streams API] In RS during enqueuing error should be reported only if readable
211         https://bugs.webkit.org/show_bug.cgi?id=152505
212
213         Reviewed by Youenn Fablet.
214
215         This commit fixes last spec change done in
216         https://github.com/whatwg/streams/commit/4ba861e6f60c248060811830e11271c84b439cc3.
217
218         Test: imported/w3c/web-platform-tests/streams-api/readable-streams/bad-strategies.html
219
220         * Modules/streams/ReadableStreamInternals.js:
221         (enqueueInReadableStream): Call @errorReadableStream only if state is readable.
222
223 2015-12-23  Chris Aljoudi <chris@chrismatic.io> and Alex Christensen <achristensen@webkit.org>
224
225         Content blockers should be able to promote http to https
226         https://bugs.webkit.org/show_bug.cgi?id=148966
227
228         Reviewed by Benjamin Poulain.
229
230         Test: http/tests/contentextensions/make-https.html
231
232         * contentextensions/ContentExtensionActions.h:
233         * contentextensions/ContentExtensionCompiler.cpp:
234         (WebCore::ContentExtensions::serializeActions):
235         * contentextensions/ContentExtensionParser.cpp:
236         (WebCore::ContentExtensions::loadAction):
237         * contentextensions/ContentExtensionRule.cpp:
238         (WebCore::ContentExtensions::Action::deserialize):
239         (WebCore::ContentExtensions::Action::deserializeType):
240         (WebCore::ContentExtensions::Action::serializedLength):
241         * contentextensions/ContentExtensionsBackend.cpp:
242         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
243         * loader/cache/CachedResourceLoader.cpp:
244         (WebCore::CachedResourceLoader::requestResource):
245         * platform/URL.cpp:
246         (WebCore::URL::isBlankURL):
247         (WebCore::defaultPortsMap):
248         (WebCore::defaultPortForProtocol):
249         (WebCore::isDefaultPortForProtocol):
250         (WebCore::portAllowed):
251         * platform/URL.h:
252
253 2015-12-22  Andy Estes  <aestes@apple.com>
254
255         Try to fix the iOS build after r194378
256
257         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
258
259 2015-12-22  Andy Estes  <aestes@apple.com>
260
261         [CF] Replace CFNetwork-related WebKitSystemInterface calls with SPI
262         https://bugs.webkit.org/show_bug.cgi?id=152463
263
264         Reviewed by Alexey Proskuryakov.
265
266         Replaced WebkitSystemInterface calls that wrapped CFNetwork SPI with direct calls to SPI that is now forward
267         declared in CFNetworkSPI.h.
268
269         Also removed some unused declarations and renamed ResourceResponseMac.mm to ResourceResponseCocoa.mm.
270
271         * PlatformMac.cmake:
272         * WebCore.xcodeproj/project.pbxproj:
273         * platform/ios/WebCoreSystemInterfaceIOS.mm:
274         * platform/mac/WebCoreSystemInterface.h:
275         * platform/mac/WebCoreSystemInterface.mm:
276         * platform/network/NetworkStorageSession.h:
277         * platform/network/cf/CredentialStorageCFNet.cpp:
278         (WebCore::copyCredentialFromProtectionSpace):
279         (WebCore::CredentialStorage::getFromPersistentStorage):
280         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
281         (WebCore::NetworkStorageSession::cookieStorage):
282         * platform/network/cf/ResourceHandleCFNet.cpp:
283         (WebCore::ResourceHandle::createCFURLConnection):
284         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
285         (WebCore::ResourceHandleCFURLConnectionDelegate::createResourceRequest):
286         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
287         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
288         * platform/network/cf/ResourceRequestCFNet.cpp:
289         (WebCore::ResourceRequest::doUpdatePlatformRequest):
290         (WebCore::ResourceRequest::doUpdateResourceRequest):
291         (WebCore::ResourceRequest::setStorageSession):
292         (WebCore::initializeMaximumHTTPConnectionCountPerHost):
293         (WebCore::initializeHTTPConnectionSettingsOnStartup):
294         * platform/network/cf/ResourceRequestCFNet.h:
295         (WebCore::toResourceLoadPriority):
296         (WebCore::toPlatformRequestPriority):
297         * platform/network/cf/ResourceResponse.h:
298         * platform/network/cf/ResourceResponseCFNet.cpp:
299         (WebCore::ResourceResponse::platformCertificateInfo):
300         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
301         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
302         * platform/network/cocoa/ResourceRequestCocoa.mm:
303         (WebCore::ResourceRequest::doUpdateResourceRequest):
304         (WebCore::ResourceRequest::doUpdatePlatformRequest):
305         * platform/network/cocoa/ResourceResponseCocoa.mm: Renamed from Source/WebCore/platform/network/mac/ResourceResponseMac.mm.
306         (WebCore::ResourceResponse::platformCertificateInfo):
307         (WebCore::copyNSURLResponseStatusLine):
308         (WebCore::ResourceResponse::platformLazyInit):
309         * platform/network/ios/QuickLook.h:
310         * platform/network/ios/QuickLook.mm:
311         * platform/network/ios/WebCoreURLResponseIOS.mm:
312         (WebCore::adjustMIMETypeIfNecessary):
313         * platform/network/mac/ResourceHandleMac.mm:
314         (WebCore::ResourceHandle::createNSURLConnection):
315         * platform/network/mac/WebCoreURLResponse.h:
316         * platform/network/mac/WebCoreURLResponse.mm:
317         (WebCore::adjustMIMETypeIfNecessary):
318         * platform/spi/cf/CFNetworkConnectionCacheSPI.h:
319         * platform/spi/cf/CFNetworkSPI.h:
320
321 2015-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
322
323         [GTK] Everything broken in GTK+ 3.19
324         https://bugs.webkit.org/show_bug.cgi?id=150550
325
326         Reviewed by Carlos Garcia Campos.
327
328         Port RenderThemeGtk and ScrollbarThemeGtk to use CSS nodes. This makes it possible to render
329         stuff with modern GTK+.
330
331         No new tests. We already have tons of tests for this functionality, but we're running them
332         with GTK+ 3.16, so they cannot have detected this breakage. These fixes require unreleased
333         GTK+, and GTK+ rendering is currently in a state of flux; once things settle down, we can
334         consider upgrading the GTK+ used for our layout tests.
335
336         * platform/gtk/GRefPtrGtk.cpp:
337         (WTF::refGPtr):
338         (WTF::derefGPtr):
339         * platform/gtk/GRefPtrGtk.h:
340         * platform/gtk/ScrollbarThemeGtk.cpp:
341         (WebCore::ScrollbarThemeGtk::themeChanged):
342         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
343         (WebCore::orientationStyleClass):
344         (WebCore::applyScrollbarStyleContextClasses):
345         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
346         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
347         (WebCore::ScrollbarThemeGtk::paintThumb):
348         (WebCore::ScrollbarThemeGtk::paintButton):
349         * rendering/RenderThemeGtk.cpp:
350         (WebCore::createStyleContext):
351         (WebCore::setToggleSize):
352         (WebCore::paintToggle):
353         (WebCore::RenderThemeGtk::paintButton):
354         (WebCore::getComboBoxMetrics):
355         (WebCore::RenderThemeGtk::paintMenuList):
356         (WebCore::RenderThemeGtk::paintTextField):
357         (WebCore::applySliderStyleContextClasses):
358         (WebCore::RenderThemeGtk::paintSliderTrack):
359         (WebCore::RenderThemeGtk::paintSliderThumb):
360         (WebCore::RenderThemeGtk::paintProgressBar):
361         (WebCore::paintSpinArrowButton):
362         (WebCore::styleColor):
363
364 2015-12-22  Eric Carlson  <eric.carlson@apple.com>
365
366         [MediaStream] MediaStreamTrackPrivate.source should be a reference
367         https://bugs.webkit.org/show_bug.cgi?id=152509
368
369         Reviewed by Tim Horton.
370
371         No new tests, no functional change.
372
373         * Modules/mediastream/MediaStream.cpp:
374         (WebCore::MediaStream::trackVectorForType):
375         * Modules/mediastream/MediaStreamTrack.h:
376         * Modules/mediastream/RTCDTMFSender.cpp:
377         (WebCore::RTCDTMFSender::create):
378         * Modules/mediastream/UserMediaRequest.cpp:
379         (WebCore::UserMediaRequest::didCreateStream):
380         * platform/mediastream/MediaStreamPrivate.cpp:
381         (WebCore::MediaStreamPrivate::platformLayer):
382         (WebCore::MediaStreamPrivate::currentFrameImage):
383         * platform/mediastream/MediaStreamTrackPrivate.cpp:
384         (WebCore::MediaStreamTrackPrivate::MediaStreamTrackPrivate):
385         * platform/mediastream/MediaStreamTrackPrivate.h:
386         (WebCore::MediaStreamTrackPrivate::source):
387
388 2015-12-22  Commit Queue  <commit-queue@webkit.org>
389
390         Unreviewed, rolling out r194362.
391         https://bugs.webkit.org/show_bug.cgi?id=152508
392
393         crashes release bot (Requested by mcatanzaro on #webkit).
394
395         Reverted changeset:
396
397         "[GTK] Everything broken in GTK+ 3.19"
398         https://bugs.webkit.org/show_bug.cgi?id=150550
399         http://trac.webkit.org/changeset/194362
400
401 2015-12-22  Keith Miller  <keith_miller@apple.com>
402
403         Remove OverridesHasInstance from TypeInfoFlags
404         https://bugs.webkit.org/show_bug.cgi?id=152005
405
406         Reviewed by Saam Barati.
407
408         Currently, we have three TypeInfo flags associated with instanceof behavior,
409         ImplementsHasInstance, ImplementDefaultHasInstance, and OverridesHasInstance. This patch
410         removes the third and moves the first to the out of line flags. In theory, we should only
411         need one flag but removing ImplementsHasInstance is more involved and should be done in a
412         separate patch.
413
414         * bindings/js/JSDOMBinding.h:
415         * bindings/scripts/CodeGeneratorJS.pm:
416         (GenerateHeader):
417
418 2015-12-22  Brent Fulgham  <bfulgham@apple.com>
419
420         Allow JavaScript to iterate over plugins for local SecurityOrigins
421         https://bugs.webkit.org/show_bug.cgi?id=152489
422
423         Reviewed by Alexey Proskuryakov.
424
425         Instead of calling 'isLocalFile' on the URL, we check the Document's SecurityOrigin. If
426         no origin exists, we construct a SecurityOrigin from the URL, and check whether it
427         satisfies 'isLocal'.
428
429         * page/Page.cpp:
430         (WebCore::Page::showAllPlugins): Revised to use SecurityOrigin.
431
432 2015-12-22  Michael Catanzaro  <mcatanzaro@igalia.com>
433
434         [GTK] Everything broken in GTK+ 3.19
435         https://bugs.webkit.org/show_bug.cgi?id=150550
436
437         Reviewed by Carlos Garcia Campos.
438
439         Port RenderThemeGtk and ScrollbarThemeGtk to use CSS nodes. This makes it possible to render
440         stuff with modern GTK+.
441
442         No new tests. We already have tons of tests for this functionality, but we're running them
443         with GTK+ 3.16, so they cannot have detected this breakage. These fixes require unreleased
444         GTK+, and GTK+ rendering is currently in a state of flux; once things settle down, we can
445         consider upgrading the GTK+ used for our layout tests.
446
447         * platform/gtk/GRefPtrGtk.cpp:
448         (WTF::refGPtr):
449         (WTF::derefGPtr):
450         * platform/gtk/GRefPtrGtk.h:
451         * platform/gtk/ScrollbarThemeGtk.cpp:
452         (WebCore::ScrollbarThemeGtk::themeChanged):
453         (WebCore::ScrollbarThemeGtk::updateThemeProperties):
454         (WebCore::orientationStyleClass):
455         (WebCore::applyScrollbarStyleContextClasses):
456         (WebCore::ScrollbarThemeGtk::paintTrackBackground):
457         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
458         (WebCore::ScrollbarThemeGtk::paintThumb):
459         (WebCore::ScrollbarThemeGtk::paintButton):
460         * rendering/RenderThemeGtk.cpp:
461         (WebCore::createStyleContext):
462         (WebCore::setToggleSize):
463         (WebCore::paintToggle):
464         (WebCore::RenderThemeGtk::paintButton):
465         (WebCore::getComboBoxMetrics):
466         (WebCore::RenderThemeGtk::paintMenuList):
467         (WebCore::RenderThemeGtk::paintTextField):
468         (WebCore::applySliderStyleContextClasses):
469         (WebCore::RenderThemeGtk::paintSliderTrack):
470         (WebCore::RenderThemeGtk::paintSliderThumb):
471         (WebCore::RenderThemeGtk::paintProgressBar):
472         (WebCore::paintSpinArrowButton):
473         (WebCore::styleColor):
474
475 2015-12-20  Jeremy Zerfas  <WebKit@JeremyZerfas.com>
476
477         Don't allocate a NSImage and skip unneeded call to TIFFRepresentation when copying image to clipboard.
478         https://bugs.webkit.org/show_bug.cgi?id=152374
479
480         Reviewed by Darin Adler.
481
482         When copying an image to the clipboard, don't bother allocating a
483         NSImage and skip the unneeded call to TIFFRepresentation since the data
484         from the previous getTIFFRepresentation call can be used instead. This
485         considerably reduces the amount of memory and CPU time used for large
486         images/animations.
487
488         Test: fast/images/image-copy-memory-usage.html
489
490         * platform/mac/PasteboardMac.mm:
491         (WebCore::Pasteboard::write):
492
493 2015-12-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
494
495         Reduce PassRefPtr uses in dom - 2
496         https://bugs.webkit.org/show_bug.cgi?id=151936
497
498         Reviewed by Darin Adler.
499
500         Change PassRefPtr with RefPtr<Foo>&&, WTF::move(), Foo*, and Foo&.
501
502         * dom/ScopedEventQueue.h:
503         * dom/ScriptedAnimationController.cpp:
504         (WebCore::ScriptedAnimationController::registerCallback):
505         * dom/ScriptedAnimationController.h:
506         * dom/StaticNodeList.h:
507         * dom/Traversal.cpp:
508         (WebCore::NodeIteratorBase::NodeIteratorBase):
509         * dom/Traversal.h:
510         * dom/TreeWalker.cpp:
511         (WebCore::TreeWalker::TreeWalker):
512         (WebCore::TreeWalker::setCurrentNode):
513         * dom/TreeWalker.h:
514         (WebCore::TreeWalker::create):
515         * dom/UserActionElementSet.h:
516         * dom/WebKitNamedFlow.cpp:
517         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
518         (WebCore::WebKitNamedFlow::create):
519         (WebCore::WebKitNamedFlow::getRegionsByContent):
520         (WebCore::WebKitNamedFlow::getRegions):
521         (WebCore::WebKitNamedFlow::getContent):
522         * dom/WebKitNamedFlow.h:
523         * dom/WheelEvent.cpp:
524         (WebCore::WheelEvent::WheelEvent):
525         (WebCore::WheelEvent::initWheelEvent):
526         (WebCore::WheelEvent::initWebKitWheelEvent):
527         * dom/WheelEvent.h:
528
529 2015-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
530
531         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
532         https://bugs.webkit.org/show_bug.cgi?id=145542
533
534         Reviewed by Darin Adler.
535
536         Perform DNS prefetch only when no proxy is configured.
537
538         No new tests. Test this manually with Wireshark. Run the simple-proxy example program found
539         in libsoup's examples directory, set that as your system HTTP proxy, and see if DNS queries
540         show up in Wireshark when refreshing a page sent over HTTP. They should appear only when the
541         proxy is not configured.
542
543         * platform/network/DNSResolveQueue.cpp:
544         (WebCore::DNSResolveQueue::DNSResolveQueue):
545         (WebCore::DNSResolveQueue::isUsingProxy):
546         * platform/network/DNSResolveQueue.h:
547         * platform/network/cf/DNSCFNet.cpp:
548         (WebCore::DNSResolveQueue::updateIsUsingProxy):
549         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted.
550         * platform/network/soup/DNSSoup.cpp:
551         (WebCore::didResolveProxy):
552         (WebCore::proxyResolvedForHttpUriCallback):
553         (WebCore::proxyResolvedForHttpsUriCallback):
554         (WebCore::DNSResolveQueue::updateIsUsingProxy):
555         (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted.
556
557 2015-12-20  Dan Bernstein  <mitz@apple.com>
558
559         Remove unused setToolbarHeight
560         https://bugs.webkit.org/show_bug.cgi?id=152466
561
562         Reviewed by Darin Adler.
563
564         * inspector/InspectorFrontendClient.h:
565         * inspector/InspectorFrontendHost.cpp:
566         (WebCore::InspectorFrontendHost::setToolbarHeight): Deleted.
567         * inspector/InspectorFrontendHost.h:
568         * inspector/InspectorFrontendHost.idl:
569         * testing/Internals.cpp:
570
571 2015-12-20  Commit Queue  <commit-queue@webkit.org>
572
573         Unreviewed, rolling out r194033 and r194267.
574         https://bugs.webkit.org/show_bug.cgi?id=152465
575
576         Caused crashes on Mac WK1 bots (Requested by youenn on
577         #webkit).
578
579         Reverted changesets:
580
581         "[Streams API] Expose ReadableStream and relatives to Worker"
582         https://bugs.webkit.org/show_bug.cgi?id=152066
583         http://trac.webkit.org/changeset/194033
584
585         "[Streams API] imported/w3c/web-platform-tests/streams-api
586         /readable-streams/cancel.html has a flaky test"
587         https://bugs.webkit.org/show_bug.cgi?id=152065
588         http://trac.webkit.org/changeset/194267
589
590 2015-12-19  Dan Bernstein  <mitz@apple.com>
591
592         [Mac] WebKit contains dead source code for OS X Mavericks and earlier
593         https://bugs.webkit.org/show_bug.cgi?id=152462
594
595         Reviewed by Alexey Proskuryakov.
596
597         - Removed build setting definitions for OS X 10.9 and earlier, and simplified defintions
598           that became uniform across all OS X versions as a result:
599
600         * Configurations/DebugRelease.xcconfig:
601         * Configurations/FeatureDefines.xcconfig:
602         * Configurations/Version.xcconfig:
603
604         - Removed support for animating default buttons:
605
606         * rendering/RenderButton.cpp:
607         (WebCore::RenderButton::RenderButton): Removed m_default initialization.
608         (WebCore::RenderButton::styleDidChange): Removed checking for animating default button and
609           starting the animation timer.
610         (WebCore::RenderButton::timerFired): Deleted.
611         * rendering/RenderButton.h: Removed m_timer and m_default member variables
612         * rendering/RenderTheme.h:
613         (WebCore::RenderTheme::defaultButtonHasAnimation): Deleted.
614         * rendering/RenderThemeMac.h: Deleted override.
615         * rendering/RenderThemeMac.mm:
616         (WebCore::RenderThemeMac::defaultButtonHasAnimation): Deleted.
617
618         - Simplified expressions involving __MAC_OS_X_VERSION_MIN_REQUIRED and removed code that was
619           never getting compiled:
620
621         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
622         * editing/mac/DictionaryLookup.h:
623         * editing/mac/DictionaryLookup.mm:
624         * html/canvas/WebGLDrawBuffers.cpp:
625         * loader/DocumentLoader.cpp:
626         * loader/cache/CachedFont.cpp:
627         * loader/cocoa/DiskCacheMonitorCocoa.h:
628         * page/cocoa/SettingsCocoa.mm:
629         * platform/Scrollbar.cpp:
630         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
631         * platform/cocoa/NetworkExtensionContentFilter.h:
632         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
633         * platform/graphics/cg/ImageSourceCG.cpp:
634         * platform/graphics/cocoa/FontCacheCoreText.cpp:
635         * platform/graphics/cocoa/FontCascadeCocoa.mm:
636         * platform/graphics/mac/GraphicsContext3DMac.mm:
637         * platform/mac/NSScrollerImpDetails.h:
638         * platform/mac/ScrollAnimatorMac.mm:
639         * platform/mac/ScrollViewMac.mm:
640         * platform/mac/ScrollbarThemeMac.mm:
641         * platform/mac/ThemeMac.mm:
642         * platform/mac/WebCoreFullScreenPlaceholderView.h:
643         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
644         * platform/network/cf/CookieJarCFNet.cpp:
645         * platform/network/cf/ResourceRequest.h:
646         * platform/spi/cf/CFNetworkSPI.h:
647         * platform/spi/cocoa/CoreTextSPI.h:
648         * platform/spi/cocoa/NSButtonCellSPI.h:
649         * platform/spi/cocoa/NSColorSPI.h:
650         * platform/spi/cocoa/QuartzCoreSPI.h:
651         * platform/spi/mac/LookupSPI.h:
652         * platform/spi/mac/NSFontSPI.h:
653         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
654         * platform/spi/mac/NSPopoverSPI.h:
655         * platform/spi/mac/NSSharingServicePickerSPI.h:
656         * platform/spi/mac/NSSharingServiceSPI.h:
657         * platform/spi/mac/TUCallSPI.h:
658         * platform/sql/SQLiteDatabase.cpp:
659
660 2015-12-18  Antti Koivisto  <antti@apple.com>
661
662         Cache redirects as separate entries
663         https://bugs.webkit.org/show_bug.cgi?id=152424
664
665         Reviewed by Alex Christensen.
666
667         Test: http/tests/cache/disk-cache/disk-cache-redirect.html
668
669         * platform/network/ResourceRequestBase.h:
670
671 2015-12-18  Per Arne Vollan  <peavo@outlook.com>
672
673         [WinCairo] Empty context menu item.
674         https://bugs.webkit.org/show_bug.cgi?id=152423
675
676         Reviewed by Alex Christensen.
677
678         The context menu contains a submenu item with no text.
679
680         * page/ContextMenuController.cpp:
681         (WebCore::ContextMenuController::populate):
682
683 2015-12-18  Michael Catanzaro  <mcatanzaro@igalia.com>
684
685         Avoid triggering clang's -Wundefined-bool-conversion
686         https://bugs.webkit.org/show_bug.cgi?id=152408
687
688         Reviewed by Mark Lam.
689
690         Remove use of ASSERT(this).
691
692         * dom/TreeScope.cpp:
693         (WebCore::TreeScope::adoptIfNeeded):
694         * page/Frame.cpp:
695         (WebCore::Frame::createView):
696
697 2015-12-18  Simon Fraser  <simon.fraser@apple.com>
698
699         Remove the 'ignoreViewportScalingConstraints' Setting, which was unused
700         https://bugs.webkit.org/show_bug.cgi?id=152435
701
702         Reviewed by Tim Horton.
703
704         r177110 added a WebCore setting called ignoreViewportScalingConstraints,
705         but it was never used, so remove it.
706
707         * page/Settings.in:
708
709 2015-12-18  Brent Fulgham  <bfulgham@apple.com>
710
711         Place an upper bound on canvas pixel count
712         https://bugs.webkit.org/show_bug.cgi?id=151825
713         <rdar://problem/23324916>
714
715         Reviewed by Simon Fraser (Relanded by Brent Fulgham)
716
717         Malformed JavaScript can attempt to create lots of canvas contexts. Limit the amount of memory
718         we will use for this purpose to some percentage of system RAM.
719
720         * html/HTMLCanvasElement.cpp:
721         (WebCore::removeFromActivePixelMemory): Added helper function
722         (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Call new 'releaseImageBufferAndContext' method
723         to ensure ImageBuffer and graphics context state are properly cleaned up.
724         (WebCore::maxActivePixels): Use one quarter of the system RAM, or 2 GB (whichever is more) as
725         an upper bound on active pixel memory.
726         (WebCore::HTMLCanvasElement::getContext): If we are attempting to create a context that will cause
727         us to exceed the allowed active pixel count, fail.
728         (WebCore::HTMLCanvasElement::releaseImageBufferAndContext): Added helper function
729         (WebCore::HTMLCanvasElement::setSurfaceSize): Use the new 'releaseImageBufferAndContext' method
730         to handle active pixel memory counts.
731         (WebCore::HTMLCanvasElement::createImageBuffer): Refuse to create a backing buffer if it will
732         exceed our available pixel memory.
733
734 2015-12-18  Olivier Blin  <olivier.blin@softathome.com>
735
736         Fix the !ENABLE(VIDEO) build after r192953 for <picture> element introduction
737         https://bugs.webkit.org/show_bug.cgi?id=152431
738
739         Since r192953, HTMLSourceElement is built even if video is disabled,
740         since it is used by the picture element.
741
742         But build was broken with -no-video, since HTMLMediaElement usage
743         should be guarded by VIDEO guards, and its JS bindings were still
744         under a video conditional.
745
746         Reviewed by Alex Christensen.
747
748         No new tests, build fix only.
749
750         * html/HTMLSourceElement.cpp:
751         (WebCore::HTMLSourceElement::insertedInto):
752         (WebCore::HTMLSourceElement::removedFrom):
753         * html/HTMLSourceElement.idl:
754
755 2015-12-18  Brady Eidson  <beidson@apple.com>
756
757         Modern IDB: Refactor when opening the backing store takes place.
758         https://bugs.webkit.org/show_bug.cgi?id=152405
759
760         Reviewed by Alex Christensen.
761
762         No new tests (At least one failing test now passes).
763
764         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
765         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Move the "open backing store" logic
766           from here to performCurrentOpenOperation.
767         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): If the database backing store is
768           not open yet, kick off opening it here.
769         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): Rework this stuff to be better.
770
771 2015-12-17  Brady Eidson  <beidson@apple.com>
772
773         Modern IDB: Refactor open/delete requests to exist in the same queue.
774         https://bugs.webkit.org/show_bug.cgi?id=152397
775
776         Reviewed by Alex Christensen.
777
778         No new tests (Refactor, all existing tests continue to pass).
779
780         The order between incoming open and delete requests matters, and each request
781         needs to be handled individually.
782         
783         This patch does the above without changing behavior on existing passing tests,
784         while moving many currently skipped tests closer to passing.
785     
786         * Modules/indexeddb/server/IDBServerOperation.cpp:
787         (WebCore::IDBServer::IDBServerOperation::notifyDeleteRequestBlocked):
788         (WebCore::IDBServer::IDBServerOperation::notifyDidDeleteDatabase):
789         * Modules/indexeddb/server/IDBServerOperation.h:
790         (WebCore::IDBServer::IDBServerOperation::hasNotifiedDeleteRequestBlocked):
791
792         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
793         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
794         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
795         (WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeInProgress):
796         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
797         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
798         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
799         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
800         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
801         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
802         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
803         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase): Deleted.
804         * Modules/indexeddb/server/UniqueIDBDatabase.h:
805
806 2015-12-17  Csaba Osztrogonác  <ossy@webkit.org>
807
808         [EFL] edje shouldn't have verbose output
809         https://bugs.webkit.org/show_bug.cgi?id=152381
810
811         Reviewed by Gyuyoung Kim.
812
813         * platform/efl/DefaultTheme/CMakeLists.txt:
814
815 2015-12-17  Commit Queue  <commit-queue@webkit.org>
816
817         Unreviewed, rolling out r194241 and r194252.
818         https://bugs.webkit.org/show_bug.cgi?id=152415
819
820         Caused crashes on GuardMalloc (Requested by ap on #webkit).
821
822         Reverted changesets:
823
824         "Modern IDB: Refactor open/delete requests to exist in the
825         same queue."
826         https://bugs.webkit.org/show_bug.cgi?id=152397
827         http://trac.webkit.org/changeset/194241
828
829         "Modern IDB: Refactor when opening the backing store takes
830         place."
831         https://bugs.webkit.org/show_bug.cgi?id=152405
832         http://trac.webkit.org/changeset/194252
833
834 2015-12-17  Brady Eidson  <beidson@apple.com>
835
836         Modern IDB: Refactor when opening the backing store takes place.
837         https://bugs.webkit.org/show_bug.cgi?id=152405
838
839         Reviewed by Alex Christensen.
840
841         No new tests (At least one failing test now passes).
842
843         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
844         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): Move the "open backing store" logic
845           from here to performCurrentOpenOperation.
846         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation): If the database backing store is
847           not open yet, kick off opening it here.
848         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): Rework this stuff to be better.
849
850 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
851
852         ViewportConfiguration functions should return a bool to say if anything changed
853         https://bugs.webkit.org/show_bug.cgi?id=152353
854
855         Reviewed by Tim Horton.
856
857         Rather than callers all checking whether setting ViewportConfiguration values
858         changes state, have its functions return a bool if the values change.
859
860         * page/ViewportConfiguration.cpp:
861         (WebCore::ViewportConfiguration::setContentsSize):
862         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
863         (WebCore::ViewportConfiguration::setViewportArguments):
864         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
865         * page/ViewportConfiguration.h:
866         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): Deleted.
867
868 2015-12-16  Joseph Pecoraro  <pecoraro@apple.com>
869
870         Web Inspector: Add JSContext Script Profiling
871         https://bugs.webkit.org/show_bug.cgi?id=151899
872
873         Reviewed by Brian Burg.
874
875         Tests: inspector/script-profiler/event-type-API.html
876                inspector/script-profiler/event-type-Microtask.html
877                inspector/script-profiler/tracking.html
878
879         * ForwardingHeaders/inspector/agents/InspectorScriptProfilerAgent.h: Added.
880
881         * inspector/InspectorController.h:
882         * inspector/InspectorController.cpp:
883         (WebCore::InspectorController::InspectorController):
884         Create the new agent, even if we don't use it yet for Page inspection.
885
886         (WebCore::InspectorController::willCallInjectedScriptFunction): Deleted.
887         (WebCore::InspectorController::didCallInjectedScriptFunction): Deleted.
888         No longer needed, implementation was pushed up into InjectedScriptBase.
889
890         * inspector/InspectorCSSAgent.cpp:
891         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
892         * inspector/InspectorReplayAgent.cpp:
893         (WebCore::buildInspectorObjectForSession):
894         Disambiguate types.
895
896 2015-12-17  Brady Eidson  <beidson@apple.com>
897
898         Modern IDB: Refactor open/delete requests to exist in the same queue.
899         https://bugs.webkit.org/show_bug.cgi?id=152397
900
901         Reviewed by Alex Christensen.
902
903         No new tests (Refactor, all existing tests continue to pass).
904
905         The order between incoming open and delete requests matters, and each request
906         needs to be handled individually.
907         
908         This patch does the above without changing behavior on existing passing tests,
909         while moving many currently skipped tests closer to passing.
910     
911         * Modules/indexeddb/server/IDBServerOperation.cpp:
912         (WebCore::IDBServer::IDBServerOperation::notifyDeleteRequestBlocked):
913         (WebCore::IDBServer::IDBServerOperation::notifyDidDeleteDatabase):
914         * Modules/indexeddb/server/IDBServerOperation.h:
915         (WebCore::IDBServer::IDBServerOperation::hasNotifiedDeleteRequestBlocked):
916
917         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
918         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
919         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
920         (WebCore::IDBServer::UniqueIDBDatabase::isVersionChangeInProgress):
921         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
922         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
923         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
924         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
925         (WebCore::IDBServer::UniqueIDBDatabase::handleDelete):
926         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
927         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
928         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase): Deleted.
929         * Modules/indexeddb/server/UniqueIDBDatabase.h:
930
931 2015-12-17  Brent Fulgham  <bfulgham@apple.com>
932
933         [Win] Prevent flashing/strobing repaints on certain hardware
934         https://bugs.webkit.org/show_bug.cgi?id=152394
935         <rdar://problem/23875302>
936
937         Reviewed by Simon Fraser.
938
939         This patch reverts a change I made in r192166, where I always set the
940         m_viewNeedsUpdate flag to true when a 'flushContext' call was made. Instead,
941         we should go back to letting the view decide when it needs to paint.
942
943         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
944         (WebCore::WKCACFViewLayerTreeHost::flushContext): Don't just claim that
945         the view needs to be updated any time we are asked to flush. 
946
947 2015-12-17  Per Arne Vollan  <peavo@outlook.com>
948
949         [WinCairo][MediaFoundation] Release Direct3D swap chain object earlier.
950         https://bugs.webkit.org/show_bug.cgi?id=152392
951
952         Reviewed by Alex Christensen.
953
954         Since we don't use the swap chain object to render the video to a window,
955         but render frames to Cairo bitmaps, we can let go of the swap chain object
956         earlier than we currently do. 
957
958         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
959         (WebCore::clearDesiredSampleTime):
960         (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::createVideoSamples):
961
962 2015-12-17  Commit Queue  <commit-queue@webkit.org>
963
964         Unreviewed, rolling out r194201.
965         https://bugs.webkit.org/show_bug.cgi?id=152391
966
967         Caused crashes with GuardMalloc (Requested by ap|away on
968         #webkit).
969
970         Reverted changeset:
971
972         "Reduce PassRefPtr uses in dom - 2"
973         https://bugs.webkit.org/show_bug.cgi?id=151936
974         http://trac.webkit.org/changeset/194201
975
976 2015-12-17  Csaba Osztrogonác  <ossy@webkit.org>
977
978         Fix unused parameter handling in WebGLRenderingContextBase.cp
979         https://bugs.webkit.org/show_bug.cgi?id=152387
980
981         Reviewed by Alex Christensen.
982
983         * html/canvas/WebGLRenderingContextBase.cpp:
984         (WebCore::WebGLRenderingContextBase::activeTexture):
985         (WebCore::WebGLRenderingContextBase::attachShader):
986         (WebCore::WebGLRenderingContextBase::bindAttribLocation):
987         (WebCore::WebGLRenderingContextBase::bindBuffer):
988         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
989         (WebCore::WebGLRenderingContextBase::bindRenderbuffer):
990         (WebCore::WebGLRenderingContextBase::bindTexture):
991         (WebCore::WebGLRenderingContextBase::bufferData):
992         (WebCore::WebGLRenderingContextBase::bufferSubData):
993         (WebCore::WebGLRenderingContextBase::compileShader):
994         (WebCore::WebGLRenderingContextBase::createShader):
995         (WebCore::WebGLRenderingContextBase::detachShader):
996         (WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
997         (WebCore::WebGLRenderingContextBase::drawArrays):
998         (WebCore::WebGLRenderingContextBase::drawElements):
999         (WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
1000         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
1001         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
1002         (WebCore::WebGLRenderingContextBase::getActiveAttrib):
1003         (WebCore::WebGLRenderingContextBase::getActiveUniform):
1004         (WebCore::WebGLRenderingContextBase::getAttachedShaders):
1005         (WebCore::WebGLRenderingContextBase::getBufferParameter):
1006         (WebCore::WebGLRenderingContextBase::getProgramParameter):
1007         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
1008         (WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
1009         (WebCore::WebGLRenderingContextBase::getShaderParameter):
1010         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
1011         (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
1012         (WebCore::WebGLRenderingContextBase::getShaderSource):
1013         (WebCore::WebGLRenderingContextBase::getTexParameter):
1014         (WebCore::WebGLRenderingContextBase::getUniform):
1015         (WebCore::WebGLRenderingContextBase::getUniformLocation):
1016         (WebCore::WebGLRenderingContextBase::getVertexAttrib):
1017         (WebCore::WebGLRenderingContextBase::linkProgram):
1018         (WebCore::WebGLRenderingContextBase::shaderSource):
1019         (WebCore::WebGLRenderingContextBase::uniform1f):
1020         (WebCore::WebGLRenderingContextBase::uniform1fv):
1021         (WebCore::WebGLRenderingContextBase::uniform1i):
1022         (WebCore::WebGLRenderingContextBase::uniform1iv):
1023         (WebCore::WebGLRenderingContextBase::uniform2f):
1024         (WebCore::WebGLRenderingContextBase::uniform2fv):
1025         (WebCore::WebGLRenderingContextBase::uniform2i):
1026         (WebCore::WebGLRenderingContextBase::uniform2iv):
1027         (WebCore::WebGLRenderingContextBase::uniform3f):
1028         (WebCore::WebGLRenderingContextBase::uniform3fv):
1029         (WebCore::WebGLRenderingContextBase::uniform3i):
1030         (WebCore::WebGLRenderingContextBase::uniform3iv):
1031         (WebCore::WebGLRenderingContextBase::uniform4f):
1032         (WebCore::WebGLRenderingContextBase::uniform4fv):
1033         (WebCore::WebGLRenderingContextBase::uniform4i):
1034         (WebCore::WebGLRenderingContextBase::uniform4iv):
1035         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
1036         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
1037         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
1038         (WebCore::WebGLRenderingContextBase::useProgram):
1039         (WebCore::WebGLRenderingContextBase::validateProgram):
1040         (WebCore::WebGLRenderingContextBase::vertexAttribPointer):
1041
1042 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1043
1044         Make SessionID use intHash
1045         https://bugs.webkit.org/show_bug.cgi?id=152356
1046
1047         Reviewed by Darin Adler.
1048
1049         * page/SessionID.h:
1050         (WTF::SessionIDHash::hash):
1051         (WTF::SessionIDHash::equal):
1052         (WTF::HashTraits<WebCore::SessionID>::emptyValue):
1053         (WTF::HashTraits<WebCore::SessionID>::constructDeletedValue):
1054         (WTF::HashTraits<WebCore::SessionID>::isDeletedValue):
1055         Use intHash instead of just casting a uint64_t to an unsigned.
1056         This reduces hash collisions in HashTables that are usually quite small so it isn't much of a problem.
1057         Also, needsDestruction hasn't been in HashTraits since r156507.
1058
1059 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1060
1061         Fix the debug region overlays for RTL documents
1062         https://bugs.webkit.org/show_bug.cgi?id=152372
1063
1064         Reviewed by Darin Adler.
1065         
1066         Fix document overlays to use document coordinates when painting, which requires
1067         translating the CTM, and counter-translating the dirtyRect by the scroll origin.
1068         This is only non-zero for RTL documents.
1069         
1070         While doing this, I noticed that the scroll origin was misplaced by the scrollbar
1071         width when using overlay scrollbars. Fix by using occupiedWidth/Height() in
1072         ScrollView::updateScrollbars(). I was not able to make a test for this change.
1073
1074         * page/FrameView.cpp:
1075         (WebCore::FrameView::adjustViewSize):
1076         * page/PageOverlay.cpp:
1077         (WebCore::PageOverlay::drawRect):
1078         * platform/ScrollView.cpp:
1079         (WebCore::ScrollView::updateScrollbars):
1080
1081 2015-12-16  Andy Estes  <aestes@apple.com>
1082
1083         [iOS] Block loading external stylesheets in the Content-Disposition: attachment sandbox
1084         https://bugs.webkit.org/show_bug.cgi?id=152375
1085         <rdar://problem/22020902>
1086
1087         Reviewed by Darin Adler.
1088
1089         Tests: http/tests/contentdispositionattachmentsandbox/at-import-stylesheets-disabled.html
1090                http/tests/contentdispositionattachmentsandbox/external-stylesheets-disabled.html
1091                http/tests/contentdispositionattachmentsandbox/xml-stylesheet-processing-instructions-disabled.html
1092
1093         * loader/cache/CachedResourceLoader.cpp:
1094         (WebCore::CachedResourceLoader::canRequest): Moved handling of CachedResource::MainResource to canRequestInContentDispositionAttachmentSandbox().
1095         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox): In addition to handling CachedResource::MainResource,
1096         added handling for CachedResource::CSSStyleSheet. Added a FIXME asking whether we should handle other types of resources, too.
1097         * loader/cache/CachedResourceLoader.h:
1098
1099 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1100
1101         ViewportConfiguration functions should return a bool to say if anything changed
1102         https://bugs.webkit.org/show_bug.cgi?id=152353
1103
1104         Reviewed by Tim Horton.
1105
1106         Rather than callers all checking whether setting ViewportConfiguration values
1107         changes state, have its functions return a bool if the values change.
1108
1109         * page/ViewportConfiguration.cpp:
1110         (WebCore::ViewportConfiguration::setContentsSize):
1111         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
1112         (WebCore::ViewportConfiguration::setViewportArguments):
1113         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
1114         * page/ViewportConfiguration.h:
1115         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): Deleted.
1116
1117 2015-12-16  Andreas Kling  <akling@apple.com>
1118
1119         Give kernel VM some hints about non-live memory-cached resources.
1120         <https://webkit.org/b/152362>
1121
1122         Reviewed by Geoffrey Garen.
1123
1124         When a file-backed CachedResource has no live clients left, and is only being kept alive
1125         because it's cached in the MemoryCache, give the OS a hint that we probably won't need
1126         that memory very soon.
1127
1128         Normally this doesn't do anything, but in case the system comes under memory pressure,
1129         the kernel can prioritize eviction of such clean-but-unneeded pages, which prevents us
1130         from throwing other processes under the bus too soon.
1131
1132         * loader/cache/CachedResource.cpp:
1133         (WebCore::CachedResource::deleteIfPossible):
1134         * platform/SharedBuffer.cpp:
1135         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
1136         * platform/SharedBuffer.h:
1137         * platform/cf/SharedBufferCF.cpp:
1138         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
1139
1140 2015-12-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1141
1142         Reduce PassRefPtr uses in dom - 2
1143         https://bugs.webkit.org/show_bug.cgi?id=151936
1144
1145         Reviewed by Darin Adler.
1146
1147         Change PassRefPtr with RefPtr<Foo>&&, WTF::move(), Foo*, and Foo&.
1148
1149         * dom/ScopedEventQueue.h:
1150         * dom/ScriptedAnimationController.cpp:
1151         (WebCore::ScriptedAnimationController::registerCallback):
1152         * dom/ScriptedAnimationController.h:
1153         * dom/StaticNodeList.h:
1154         * dom/Traversal.cpp:
1155         (WebCore::NodeIteratorBase::NodeIteratorBase):
1156         * dom/Traversal.h:
1157         * dom/TreeWalker.cpp:
1158         (WebCore::TreeWalker::TreeWalker):
1159         (WebCore::TreeWalker::setCurrentNode):
1160         * dom/TreeWalker.h:
1161         (WebCore::TreeWalker::create):
1162         * dom/UserActionElementSet.h:
1163         * dom/WebKitNamedFlow.cpp:
1164         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
1165         (WebCore::WebKitNamedFlow::create):
1166         (WebCore::WebKitNamedFlow::getRegionsByContent):
1167         (WebCore::WebKitNamedFlow::getRegions):
1168         (WebCore::WebKitNamedFlow::getContent):
1169         * dom/WebKitNamedFlow.h:
1170         * dom/WheelEvent.cpp:
1171         (WebCore::WheelEvent::WheelEvent):
1172         (WebCore::WheelEvent::initWheelEvent):
1173         (WebCore::WheelEvent::initWebKitWheelEvent):
1174         * dom/WheelEvent.h:
1175
1176 2015-12-16  Simon Fraser  <simon.fraser@apple.com>
1177
1178         Simplify isOverlayScrollbar() logic
1179         https://bugs.webkit.org/show_bug.cgi?id=152357
1180
1181         Reviewed by Beth Dakin.
1182
1183         Replace code that checks for isOverlayScrollbar() explicitly with calls to new
1184         occupiedWidth()/occupiedHeight() functions on Scrollbar, which do the overlay
1185         scrollbar check internally.
1186         
1187         Add ScrollableArea::scrollbarIntrusion() which returns an IntSize with the occupiedWidth
1188         and occupiedHeight of any scrollbars, and use it in a few places.
1189
1190         * page/FrameView.cpp:
1191         (WebCore::FrameView::autoSizeIfEnabled):
1192         * platform/ScrollView.cpp:
1193         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
1194         (WebCore::ScrollView::calculateOverhangAreasForPainting):
1195         * platform/ScrollableArea.cpp:
1196         (WebCore::ScrollableArea::scrollbarIntrusion):
1197         (WebCore::ScrollableArea::visibleContentRectInternal):
1198         * platform/ScrollableArea.h:
1199         * platform/Scrollbar.cpp:
1200         (WebCore::Scrollbar::occupiedWidth):
1201         (WebCore::Scrollbar::occupiedHeight):
1202         * platform/Scrollbar.h:
1203         * rendering/RenderLayer.cpp:
1204         (WebCore::RenderLayer::visibleContentRectInternal):
1205         * rendering/RenderListBox.cpp:
1206         (WebCore::RenderListBox::verticalScrollbarWidth):
1207
1208 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1209
1210         Fix internal Windows build
1211         https://bugs.webkit.org/show_bug.cgi?id=152364
1212         rdar://problem/23928759
1213
1214         Reviewed by Tim Horton.
1215
1216         * WebCore.vcxproj/WebCore.proj:
1217
1218 2015-12-16  Brady Eidson  <beidson@apple.com>
1219
1220         Modern IDB: Refactor UniqueIDBDatabase in preparation for consolidation open and delete requests.
1221         https://bugs.webkit.org/show_bug.cgi?id=152355
1222
1223         Reviewed by Alex Christensen.
1224
1225         No new tests (Refactor, existing tests pass).
1226
1227         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1228         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection):
1229         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1230         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1231         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
1232         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1233         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1234         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Deleted.
1235         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1236
1237 2015-12-16  Brady Eidson  <beidson@apple.com>
1238
1239         Modern IDB: Have IDBServerOperations know whether they represent an open or delete request.
1240         https://bugs.webkit.org/show_bug.cgi?id=152351
1241
1242         Reviewed by Alex Christensen.
1243
1244         No new tests (Refactor, existing tests pass).
1245
1246         * Modules/indexeddb/IndexedDB.h:
1247         
1248         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
1249         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
1250         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
1251         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
1252         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
1253         
1254         * Modules/indexeddb/client/IDBRequestImpl.h:
1255         (WebCore::IDBClient::IDBRequest::requestType):
1256         
1257         * Modules/indexeddb/server/IDBServerOperation.cpp:
1258         (WebCore::IDBServer::IDBServerOperation::isOpenRequest):
1259         (WebCore::IDBServer::IDBServerOperation::isDeleteRequest):
1260         * Modules/indexeddb/server/IDBServerOperation.h:
1261         
1262         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1263         (WebCore::IDBServer::UniqueIDBDatabase::maybeDeleteDatabase):
1264         (WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
1265         (WebCore::IDBServer::UniqueIDBDatabase::startVersionChangeTransaction):
1266         (WebCore::IDBServer::UniqueIDBDatabase::notifyConnectionsOfVersionChangeForUpgrade):
1267         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1268         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1269         
1270         * Modules/indexeddb/shared/IDBRequestData.cpp:
1271         (WebCore::IDBRequestData::IDBRequestData):
1272         * Modules/indexeddb/shared/IDBRequestData.h:
1273         (WebCore::IDBRequestData::isOpenRequest):
1274         (WebCore::IDBRequestData::isDeleteRequest):
1275
1276 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1277
1278         Build fix after r194156.
1279
1280         * platform/network/cf/ResourceHandleCFNet.cpp:
1281         (WebCore::ResourceHandle::createCFURLConnection):
1282
1283 2015-12-16  Brady Eidson  <beidson@apple.com>
1284
1285         Modern IDB: Combine handling open requests, delete requests, and transactions into one timer.
1286         https://bugs.webkit.org/show_bug.cgi?id=152344
1287
1288         Reviewed by Alex Christensen.
1289
1290         No new tests (Refactor, existing tests pass).
1291
1292         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1293         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1294         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1295         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
1296         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
1297         (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
1298         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1299         (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
1300         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted):
1301         (WebCore::IDBServer::UniqueIDBDatabase::invokeDeleteOrRunTransactionTimer): Deleted.
1302         (WebCore::IDBServer::UniqueIDBDatabase::deleteOrRunTransactionsTimerFired): Deleted.
1303         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1304
1305 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1306
1307         Build fix after r194156.
1308
1309         * platform/network/cf/ResourceHandleCFNet.cpp:
1310         * platform/network/mac/ResourceHandleMac.mm:
1311         Include definition of _TimingDataOptionsEnableW3CNavigationTiming
1312
1313 2015-12-16  Alex Christensen  <achristensen@webkit.org>
1314
1315         Implement Web Timing when using NETWORK_SESSION
1316         https://bugs.webkit.org/show_bug.cgi?id=152285
1317
1318         Reviewed by Darin Adler.
1319
1320         Covered by existing tests.
1321
1322         * WebCore.xcodeproj/project.pbxproj:
1323         * platform/network/ResourceHandle.h:
1324         * platform/network/ResourceLoadTiming.h:
1325         (WebCore::ResourceLoadTiming::encode):
1326         Moved setCollectsTimingData from ResourceHandle to ResourceLoadTiming.h to be shared 
1327         with WebKit2 when using NETWORK_SESSION, which does not use ResourceHandle.
1328         Also moved getConnectionTimingData to copyTimingData in ResourceLoadTiming for the same reason.
1329         * platform/network/cf/ResourceHandleCFNet.cpp:
1330         (WebCore::ResourceHandle::createCFURLConnection):
1331         (WebCore::ResourceHandle::start):
1332         Use the proper definition of _TimingDataOptionsEnableW3CNavigationTiming.
1333         * platform/network/cocoa/ResourceLoadTiming.mm: Added.
1334         (WebCore::timingValue):
1335         (WebCore::copyTimingData):
1336         Moved from getConnectionTimingData, and use objectForKey instead of valueForKey,
1337         and check to see if there is no object in the dictionary with the given key.
1338         This should never happen with the current CFNetwork implementation, but it's good to check dictionaries.
1339         (WebCore::setCollectsTimingData):
1340         Use _collectTimingDataWithOptions, which should be a slight performance improvement on Mavericks
1341         because we are not collecting unused timing data. Hooray!
1342         * platform/network/mac/ResourceHandleMac.mm:
1343         (WebCore::ResourceHandle::createNSURLConnection):
1344         (WebCore::ResourceHandle::getConnectionTimingData):
1345         (WebCore::ResourceHandle::setCollectsTimingData): Deleted.
1346         * platform/spi/cf/CFNetworkSPI.h:
1347         * platform/spi/cocoa/NSURLConnectionSPI.h:
1348         Moved definitions of SPI to proper SPI headers.
1349
1350 2015-12-16  Beth Dakin  <bdakin@apple.com>
1351
1352         Legacy style scrollbars do not change color when you mouse over them if you 
1353         are scrolled
1354         https://bugs.webkit.org/show_bug.cgi?id=152319
1355         -and corresponding-
1356         rdar://problem/23317668
1357
1358         Reviewed by Darin Adler.
1359
1360         The scrollbar’s frameRect is in window coordinates, so we need to compare a 
1361         point in window coordinates when we test this.
1362
1363         The call to convertFromContainingWindow does not return a point in view 
1364         coordinates, so we should not call the variable viewPoint. We do still need 
1365         to call it for subframes. convertFromContainingWindow doesn’t do anything for 
1366         the root ScrollView (for Mac WK2 at least).
1367         * platform/ScrollView.cpp:
1368         (WebCore::ScrollView::scrollbarAtPoint):
1369
1370         HitTestLocation is in contents coordinates. It needs to be converted to 
1371         window coordinates
1372         * rendering/RenderView.cpp:
1373         (WebCore::RenderView::hitTest):
1374
1375 2015-12-08  Sergio Villar Senin  <svillar@igalia.com>
1376
1377         Fix computation of min|max-content contribution of non-replaced blocks
1378         https://bugs.webkit.org/show_bug.cgi?id=152004
1379
1380         Reviewed by Darin Adler.
1381
1382         WebKit currently always returns the min preferred logical
1383         width for the min-content contribution (and the max preferred
1384         logical width for the max-content contribution) for
1385         non-replaced blocks. That is not correct according to specs
1386         https://drafts.csswg.org/css-sizing/#block-intrinsic.
1387
1388         The min-content and max-content contributions actually depend
1389         on the computed inline size of the block:
1390         * for min-content,max-content or definite sizes: min-content
1391         and max-content contributions are the inline size plus border,
1392         margin and padding.
1393         * otherwise: min-content contribution is the min-content size
1394         and max-content contribution is the max-content size (in both
1395         cases plus border, padding and margin).
1396
1397         Tests: fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1398                fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1399                fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1400                fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1401                fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1402                fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1403                fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html
1404                fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html
1405                fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1406                fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1407                fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1408                fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1409                fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html
1410                fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html
1411
1412         * rendering/RenderBlock.cpp:
1413         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1414
1415 2015-12-16  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1416
1417         [Fetch API] Add fetch API compile time flag
1418         https://bugs.webkit.org/show_bug.cgi?id=152254
1419
1420         Reviewed by Darin Adler.
1421
1422         * Configurations/FeatureDefines.xcconfig:
1423
1424 2015-12-15  Zalan Bujtas  <zalan@apple.com>
1425
1426         FontCascade cleanup: Remove ::drawSimpleText and ::drawComplexText.
1427         https://bugs.webkit.org/show_bug.cgi?id=152323
1428
1429         Reviewed by Myles C. Maxfield.
1430
1431         Platform code for ::drawComplexText() is redundant and has 
1432         no platform dependent logic. Move it all to ::drawText()
1433
1434         No change in functionality.
1435
1436         * platform/graphics/FontCascade.cpp:
1437         (WebCore::FontCascade::glyphBufferForTextRun):
1438         (WebCore::FontCascade::drawText):
1439         (WebCore::FontCascade::drawSimpleText): Deleted.
1440         * platform/graphics/FontCascade.h:
1441         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1442         (WebCore::FontCascade::drawComplexText): Deleted.
1443         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1444         (WebCore::FontCascade::drawComplexText): Deleted.
1445         * platform/graphics/win/FontWin.cpp:
1446         (WebCore::FontCascade::drawComplexText): Deleted.
1447
1448 2015-12-15  Tim Horton  <timothy_horton@apple.com>
1449
1450         [Mac] Gesture Events should not have negative scale
1451         https://bugs.webkit.org/show_bug.cgi?id=151065
1452         <rdar://problem/23474123>
1453
1454         Reviewed by Anders Carlsson.
1455
1456         * page/EventHandler.cpp:
1457         (WebCore::EventHandler::clear):
1458         * page/EventHandler.h:
1459         Make it possible to use m_gestureInitialDiameter for Mac gesture events too.
1460
1461 2015-12-15  Timothy Horton  <timothy_horton@apple.com>
1462
1463         Try to fix the CMake build
1464
1465         * CMakeLists.txt:
1466
1467 2015-12-15  Timothy Horton  <timothy_horton@apple.com>
1468
1469         Try to fix the CMake build
1470
1471         * CMakeLists.txt:
1472
1473 2015-12-15  Tim Horton  <timothy_horton@apple.com>
1474
1475         REGRESSION (r191849): There's no yellow bouncy highlight when using Find on Page on iOS
1476         https://bugs.webkit.org/show_bug.cgi?id=152241
1477         <rdar://problem/23642574>
1478
1479         Reviewed by Simon Fraser.
1480
1481         Tests: pageoverlay/overlay-small-frame-mouse-events.html
1482                pageoverlay/overlay-small-frame-paints.html
1483
1484         * page/PageOverlay.cpp:
1485         (WebCore::PageOverlay::bounds):
1486         Revert r191849's change that made bounds() actually return the frame()
1487         if we frame is manually overriden.
1488
1489         (WebCore::PageOverlay::mouseEvent):
1490         Convert the mouse event the rest of the way into overlay coordinates (by
1491         applying the overlay's frame origin) before deciding whether to handle
1492         the event.
1493
1494         * page/PageOverlay.h:
1495
1496         * DerivedSources.make:
1497         * WebCore.xcodeproj/project.pbxproj:
1498         * testing/Internals.cpp:
1499         (WebCore::Internals::installMockPageOverlay):
1500         * testing/Internals.h:
1501         * testing/Internals.idl:
1502         * testing/MockPageOverlay.cpp: Added.
1503         (WebCore::MockPageOverlay::create):
1504         (WebCore::MockPageOverlay::MockPageOverlay):
1505         (WebCore::MockPageOverlay::setFrame):
1506         * testing/MockPageOverlay.h: Added.
1507         (WebCore::MockPageOverlay::overlay):
1508         * testing/MockPageOverlay.idl: Added.
1509         * testing/MockPageOverlayClient.cpp:
1510         (WebCore::MockPageOverlayClient::installOverlay):
1511         (WebCore::MockPageOverlayClient::uninstallAllOverlays):
1512         (WebCore::MockPageOverlayClient::pageOverlayDestroyed):
1513         (WebCore::MockPageOverlayClient::drawRect):
1514         (WebCore::MockPageOverlayClient::mouseEvent):
1515         * testing/MockPageOverlayClient.h:
1516         Make internals.installMockPageOverlay return a MockPageOverlay object so
1517         tests can manipulate their overlay. For now, expose setFrame.
1518         Also, log when MockPageOverlayClient gets asked to paint or receives a mouse event,
1519         which will show up in test output. Slightly unconventional, but very convenient.
1520
1521 2015-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
1522
1523         [Font Features] TrueType fonts trigger real features even when synthesis is applied
1524         https://bugs.webkit.org/show_bug.cgi?id=152287
1525
1526         Reviewed by Darin Adler.
1527
1528         When using a font feature that is synthesizable, and synthesis is triggered,
1529         we should make sure to turn off the original font feature. Otherwise, the
1530         feature will be applied twice on top of itself.
1531
1532         This worked for OpenType fonts, but not for TrueType fonts.
1533
1534         Tests: css3/font-variant-petite-caps-synthesis.html
1535                css3/font-variant-small-caps-synthesis.html
1536                css3/font-variant-petite-caps-synthesis-coverage.html
1537                css3/font-variant-small-caps-synthesis-coverage.html
1538
1539         * platform/graphics/cocoa/FontCocoa.mm:
1540         (WebCore::defaultSelectorForTrueTypeFeature):
1541         (WebCore::removedFeature):
1542         (WebCore::createCTFontWithoutSynthesizableFeatures):
1543
1544 2015-12-15  Per Arne Vollan  <peavo@outlook.com>
1545
1546         [WinCairo][MediaFoundation] Full screen mode is not supported.
1547         https://bugs.webkit.org/show_bug.cgi?id=152300
1548
1549         Reviewed by Darin Adler.
1550
1551         We need to let WebCore know MediaFoundation supports full screen mode.
1552
1553         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1554         (WebCore::MediaPlayerPrivateMediaFoundation::pause):
1555         (WebCore::MediaPlayerPrivateMediaFoundation::supportsFullscreen):
1556         (WebCore::MediaPlayerPrivateMediaFoundation::naturalSize):
1557         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1558
1559 2015-12-15  Javier Fernandez  <jfernandez@igalia.com>
1560
1561         [css-align][css-grid] Overflow alignment value 'true' renamed to 'unsafe'
1562         https://bugs.webkit.org/show_bug.cgi?id=152251
1563
1564         Reviewed by Darin Adler.
1565
1566         The 'True' Overflow Alignment keyword is now defined in the Box Alignment
1567         specification as 'Unsafe'.
1568
1569         This patch applies the required changes in the CSS parsing logic, as well
1570         Grid Layout specific codebase, so it complies with the last version of the
1571         spec.
1572
1573         No new tests, no change in functionality.
1574
1575         * css/CSSParser.cpp:
1576         (WebCore::isAlignmentOverflowKeyword):
1577         (WebCore::CSSParser::parseItemPositionOverflowPosition):
1578         * css/CSSPrimitiveValueMappings.h:
1579         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1580         (WebCore::CSSPrimitiveValue::operator OverflowAlignment):
1581         * css/CSSValueKeywords.in:
1582         * rendering/RenderGrid.cpp:
1583         (WebCore::computeOverflowAlignmentOffset):
1584         * rendering/style/RenderStyleConstants.h:
1585
1586 2015-12-15  Zan Dobersek  <zdobersek@igalia.com>
1587
1588         [TexMap] Operate with a reference to the TextureMapper wherever possible
1589         https://bugs.webkit.org/show_bug.cgi?id=152118
1590
1591         Reviewed by Martin Robinson.
1592
1593         In most cases where used, the pointer to the TextureMapper is non-null, so it
1594         should really be a reference. The pointer is still used for the
1595         TextureMapperLayer member variable which is null until the TextureMapper object
1596         is created and set on the root layer.
1597
1598         * platform/graphics/GraphicsContext3DPrivate.cpp:
1599         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1600         * platform/graphics/GraphicsContext3DPrivate.h:
1601         * platform/graphics/cairo/ImageBufferCairo.cpp:
1602         (WebCore::ImageBufferData::paintToTextureMapper):
1603         * platform/graphics/cairo/ImageBufferDataCairo.h:
1604         * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
1605         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1606         * platform/graphics/efl/GraphicsContext3DPrivate.h:
1607         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1608         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
1609         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1610         * platform/graphics/surfaces/GraphicsSurface.cpp:
1611         (WebCore::GraphicsSurface::paintToTextureMapper):
1612         * platform/graphics/surfaces/GraphicsSurface.h:
1613         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
1614         (WebCore::GraphicsSurface::platformPaintToTextureMapper):
1615         * platform/graphics/texmap/BitmapTexture.cpp:
1616         (WebCore::BitmapTexture::updateContents):
1617         * platform/graphics/texmap/BitmapTexture.h:
1618         (WebCore::BitmapTexture::applyFilters):
1619         * platform/graphics/texmap/BitmapTextureGL.cpp:
1620         (WebCore::BitmapTextureGL::applyFilters):
1621         * platform/graphics/texmap/BitmapTextureGL.h:
1622         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1623         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
1624         * platform/graphics/texmap/TextureMapperBackingStore.h:
1625         (WebCore::TextureMapperBackingStore::drawRepaintCounter):
1626         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
1627         (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
1628         * platform/graphics/texmap/TextureMapperFPSCounter.h:
1629         * platform/graphics/texmap/TextureMapperLayer.cpp:
1630         (WebCore::TextureMapperPaintOptions::TextureMapperPaintOptions):
1631         (WebCore::TextureMapperLayer::paint):
1632         (WebCore::TextureMapperLayer::paintSelf):
1633         (WebCore::TextureMapperLayer::paintSelfAndChildren):
1634         (WebCore::TextureMapperLayer::paintUsingOverlapRegions):
1635         (WebCore::TextureMapperLayer::applyMask):
1636         (WebCore::TextureMapperLayer::paintIntoSurface):
1637         (WebCore::commitSurface):
1638         (WebCore::TextureMapperLayer::paintWithIntermediateSurface):
1639         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
1640         (WebCore::TextureMapperPlatformLayer::drawBorder):
1641         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1642         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1643         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
1644         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
1645         (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
1646         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
1647         * platform/graphics/texmap/TextureMapperTile.cpp:
1648         (WebCore::TextureMapperTile::updateContents):
1649         (WebCore::TextureMapperTile::paint):
1650         * platform/graphics/texmap/TextureMapperTile.h:
1651         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1652         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
1653         (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
1654         (WebCore::TextureMapperTiledBackingStore::drawBorder):
1655         (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
1656         (WebCore::TextureMapperTiledBackingStore::updateContents):
1657         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
1658
1659 2015-12-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1660
1661         WebIDL generator should support the possibility for C++ classes to have a JS Builtin constructor
1662         https://bugs.webkit.org/show_bug.cgi?id=152171
1663
1664         Reviewed by Darin Adler.
1665
1666         Reintroducing JSBuiltinConstructor keyword as a way to run automatically a JS builtin initialization function
1667         to process the arguments passed to the DOM C++ constructor.
1668
1669         Specialized createJSObject for those classes.
1670
1671         Fixing typo in TestCustomConstructor.idl.
1672
1673         Covered by binding tests.
1674
1675         * bindings/scripts/CodeGeneratorJS.pm:
1676         (GenerateConstructorDefinition):
1677         (IsConstructable):
1678         (IsJSBuiltinConstructor):
1679         (AddJSBuiltinIncludesIfNeeded):
1680         * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructor.cpp: Added.
1681         * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructor.h: Added.
1682         * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorPrivate.h: Added.
1683         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: Added.
1684         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h: Added.
1685         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.h: Added.
1686         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructor.mm: Added.
1687         * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorInternal.h: Added.
1688         * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl: Copied from Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl.
1689         * bindings/scripts/test/TestCustomConstructor.idl:
1690
1691 2015-12-14  Andreas Kling  <akling@apple.com>
1692
1693         ResourceUsageOverlay should show GC timers.
1694         <https://webkit.org/b/152151>
1695
1696         Reviewed by Darin Adler.
1697
1698         Add countdowns until next Eden and Full GC to the overlay. It also shows if there
1699         is no garbage collection scheduled. This will be helpful in understanding why GC
1700         sometimes takes a very long time to happen.
1701
1702         * page/ResourceUsageOverlay.h:
1703         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1704         (WebCore::formatByteNumber): Drive-by silly math fix. :|
1705         (WebCore::gcTimerString):
1706         (WebCore::ResourceUsageOverlay::platformDraw):
1707         (WebCore::nextFireTimeForGCTimer):
1708         (WebCore::runSamplerThread):
1709
1710 2015-12-14  Chris Fleizach  <cfleizach@apple.com>
1711
1712         AX: iOS: Text field variations do not have the correct traits
1713         https://bugs.webkit.org/show_bug.cgi?id=152237
1714
1715         Reviewed by Mario Sanchez Prada.
1716
1717         Make search fields and text areas use the appropriate iOS traits to 
1718         distinguish them.
1719
1720         Test: accessibility/ios-simulator/textentry-traits.html
1721
1722         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1723         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
1724         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
1725         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
1726
1727 2015-12-14  Tim Horton  <timothy_horton@apple.com>
1728
1729         Remove some Mavericks guards in ServicesOverlayController
1730         https://bugs.webkit.org/show_bug.cgi?id=152238
1731
1732         Reviewed by Darin Adler.
1733
1734         * page/mac/ServicesOverlayController.mm:
1735         (WebCore::ServicesOverlayController::selectionRectsDidChange): Deleted.
1736         (WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Deleted.
1737         The whole file is already PLATFORM(MAC) guarded, and the 10.9 guards
1738         are no longer necessary.
1739
1740 2015-12-14  Daniel Bates  <dabates@apple.com>
1741
1742         [iOS] DOM click event may not be dispatched when page has :active style and <input type="search">
1743         https://bugs.webkit.org/show_bug.cgi?id=144451
1744         <rdar://problem/23099482>
1745
1746         Reviewed by Simon Fraser.
1747
1748         Fixes an issue where a DOM click event is not dispatched to an element in a subframe on a page
1749         that has a <input type="search"> and defines a CSS :active pseudo-class for the HTML body element.
1750
1751         On iOS we only dispatch a DOM click event if the content of the page does not change as part of
1752         dispatching a DOM mousemove event at the tapped element as a means of providing a good user
1753         experience on web pages that reveal or hide content based on mouse hover. Currently we consider
1754         the content of the page to have changed if the visibility of any element on the page changes.
1755         In particular we consider the content of the page to have changed if the visibility of a user
1756         agent shadow DOM element changes (e.g. the search field cancel button). Instead we should only
1757         consider visibility changes to the actual web page content and ignore visibility changes to
1758         user agent shadow DOM elements.
1759
1760         Tests: fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html
1761                fast/forms/search/search-cancel-button-visible-when-input-becomes-disabled.html
1762                fast/forms/search/search-cancel-button-visible-when-input-becomes-readonly.html
1763                fast/forms/search/search-cancel-in-formerly-invisible-element.html
1764                fast/forms/search/search-cancel-toggle-visibility-initially-hidden.html
1765                fast/forms/search/search-cancel-toggle-visibility-initially-visible.html
1766
1767         * style/StyleResolveTree.cpp:
1768         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle):
1769         Ignore visibility changes to user agent shadow DOM elements.
1770
1771 2015-12-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1772
1773         [Streams API] Directly use @then as much as possible
1774         https://bugs.webkit.org/show_bug.cgi?id=151631
1775
1776         Reviewed by Darin Adler.
1777
1778         Moved from @Promise.prototype.@then.@call(promise,...) to promise.@then.(...)
1779         for promise objects that are not exposed to user scripts.
1780
1781         Updated promiseInvokeXX stream utility functions to ensure that returned promise always has a @then.
1782         This allows improving the readability of code calling promiseInvokeXX functions.
1783         Changed invokeOrNoop to promiseInvokeOrNoopNoCatch as invokeOrNoop
1784         result is always wrapped as a promise using Promise.resolve.
1785
1786         No change in behavior.
1787
1788         * Modules/streams/ReadableStream.js:
1789         (initializeReadableStream):
1790         * Modules/streams/ReadableStreamInternals.js:
1791         (teeReadableStream):
1792         (teeReadableStreamBranch2CancelFunction):
1793         (cancelReadableStream):
1794         * Modules/streams/StreamInternals.js:
1795         (shieldingPromiseResolve): introduced this routine to ensure the returned promise has a @then property.
1796         (promiseInvokeOrNoopNoCatch):
1797         (promiseInvokeOrNoop):
1798         (promiseInvokeOrFallbackOrNoop):
1799         * Modules/streams/WritableStream.js:
1800         (initializeWritableStream):
1801         (abort):
1802         * Modules/streams/WritableStreamInternals.js:
1803         (callOrScheduleWritableStreamAdvanceQueue):
1804
1805 2015-12-14  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1806
1807         [Streams API] Expose ReadableStream and relatives to Worker
1808         https://bugs.webkit.org/show_bug.cgi?id=152066
1809
1810         Reviewed by Darin Adler.
1811
1812         Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
1813         This file should be generated by the builtin generator once refactoring is done.
1814         This code is located in JSBuiltinFunctions::initialize.
1815
1816         Moving ReadableStream private constructors and constants code from JSDOMWindowBase to JSDOMGlobalObject.
1817         Calling JSBuiltinInternalFunctions::initialize in JSDOMGlobalObject so that internals are also available in Worker.
1818
1819         Made ReadableStream and relatives exposed in Worker.
1820
1821         Patch by Youenn Fablet.
1822         Rebased and fixed style by Xabier Rodriguez Calvar.
1823
1824         Covered by rebased tests.
1825
1826         * CMakeLists.txt:
1827         * Modules/streams/ByteLengthQueuingStrategy.idl:
1828         * Modules/streams/CountQueuingStrategy.idl:
1829         * Modules/streams/ReadableStream.idl:
1830         * Modules/streams/ReadableStreamController.idl:
1831         * Modules/streams/ReadableStreamReader.idl:
1832         * WebCore.xcodeproj/project.pbxproj:
1833         * bindings/js/JSDOMGlobalObject.cpp:
1834         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
1835         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1836         (WebCore::JSDOMGlobalObject::finishCreation):
1837         (WebCore::JSDOMGlobalObject::visitChildren):
1838         * bindings/js/JSDOMGlobalObject.h:
1839         * bindings/js/JSDOMWindowBase.cpp:
1840         (WebCore::JSDOMWindowBase::finishCreation): Deleted.
1841         (WebCore::JSDOMWindowBase::visitChildren): Deleted.
1842         * bindings/js/JSDOMWindowBase.h:
1843         * bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
1844         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
1845         (WebCore::JSBuiltinInternalFunctions::visit):
1846         (WebCore::JSBuiltinInternalFunctions::initialize):
1847         * bindings/js/WebCoreJSBuiltinInternals.h:
1848         * bindings/js/WebCoreJSBuiltins.h:
1849
1850 2015-12-14  Frederic Wang  <fred.wang@free.fr>
1851
1852         Move MathMLOperatorDictionary features into a separate module.
1853         https://bugs.webkit.org/show_bug.cgi?id=152242
1854
1855         Reviewed by Martin Robinson.
1856
1857         The definitions, properties and search of the MathML operator dictionary are really independent of the renderer object for math operators.
1858         This patch moves them in a separate module/file to make them more manageable and readable.
1859         No new tests. We already have sufficient test coverage.
1860
1861         * CMakeLists.txt:
1862         * WebCore.vcxproj/WebCore.vcxproj:
1863         * WebCore.vcxproj/WebCore.vcxproj.filters:
1864         * WebCore.xcodeproj/project.pbxproj:
1865         * rendering/mathml/MathMLOperatorDictionary.cpp:
1866         (WebCore::ExtractKey):
1867         (WebCore::ExtractChar):
1868         (WebCore::ExtractKeyHorizontal):
1869         (WebCore::MathMLOperatorDictionary::getEntry):
1870         (WebCore::MathMLOperatorDictionary::isVertical):
1871         * rendering/mathml/MathMLOperatorDictionary.h: Added.
1872         * rendering/mathml/RenderMathMLOperator.cpp:
1873         (WebCore::RenderMathMLOperator::setOperatorProperties):
1874         (WebCore::MathMLOperatorDictionary::ExtractKey): Deleted.
1875         (WebCore::MathMLOperatorDictionary::ExtractChar): Deleted.
1876         (WebCore::MathMLOperatorDictionary::ExtractKeyHorizontal): Deleted.
1877         * rendering/mathml/RenderMathMLOperator.h:
1878
1879 2015-12-14  Sergio Villar Senin  <svillar@igalia.com>
1880
1881         [css-grid] Fix height computation of grid items with borders
1882         https://bugs.webkit.org/show_bug.cgi?id=151800
1883
1884         Reviewed by Darin Adler.
1885
1886         When computing the logical height of grid items for the
1887         default "min-height: auto;" case we were constraning the
1888         min-content size using constrainLogicalHeightByMinMax()
1889         instead of constrainContentLogicalHeightByMinMax(). The
1890         problem of using the former is that we were adding the borders
1891         twice.
1892
1893         Test: fast/css-grid-layout/grid-item-with-border-in-intrinsic.html
1894
1895         * rendering/RenderBox.cpp:
1896         (WebCore::RenderBox::computeLogicalHeight):
1897
1898 2015-12-13  Tim Horton  <timothy_horton@apple.com>
1899
1900         Adopt CGIOSurfaceContextCreateImageReference to avoid unnecessary readback
1901         https://bugs.webkit.org/show_bug.cgi?id=150988
1902         <rdar://problem/18993594>
1903
1904         Reviewed by Darin Adler.
1905
1906         * platform/graphics/GraphicsContext.cpp:
1907         (WebCore::GraphicsContext::drawConsumingImageBuffer):
1908         * platform/graphics/GraphicsContext.h:
1909         * platform/graphics/ImageBuffer.h:
1910         * platform/graphics/cg/ImageBufferCG.cpp:
1911         (WebCore::createBitmapImageAfterScalingIfNeeded):
1912         (WebCore::ImageBuffer::copyImage):
1913         (WebCore::ImageBuffer::sinkIntoImage):
1914         (WebCore::ImageBuffer::sinkIntoNativeImage):
1915         (WebCore::ImageBuffer::drawConsuming):
1916         * platform/graphics/cocoa/IOSurface.h:
1917         * platform/graphics/cocoa/IOSurface.mm:
1918         (IOSurface::createFromImageBuffer):
1919         (IOSurface::sinkIntoImage):
1920         Add sinkIntoImage, sinkIntoNativeImage, and drawConsuming to ImageBuffer,
1921         which all consume the ImageBuffer and allow us to tell the system to
1922         make a CGImage that references the IOSurface, which is in many cases
1923         more efficient than making an image with a "copy" of the IOSurface.
1924         (The copy is done lazily, but we often hit a corner case that causes
1925         it to happen unnecessarily.)
1926
1927         * html/shadow/MediaControlElements.cpp:
1928         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1929         * page/TextIndicator.cpp:
1930         (WebCore::takeSnapshot):
1931         * platform/DragImage.cpp:
1932         (WebCore::createDragImageFromSnapshot):
1933         * platform/graphics/filters/FETile.cpp:
1934         (WebCore::FETile::platformApplySoftware):
1935         * platform/mac/ThemeMac.mm:
1936         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1937         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1938         (WebCore::AVVideoCaptureSource::currentFrameImage):
1939         * rendering/RenderBoxModelObject.cpp:
1940         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1941         * rendering/RenderThemeMac.mm:
1942         (WebCore::RenderThemeMac::paintProgressBar):
1943         * rendering/svg/RenderSVGResourcePattern.cpp:
1944         (WebCore::RenderSVGResourcePattern::buildPattern):
1945         * svg/graphics/SVGImage.cpp:
1946         (WebCore::SVGImage::drawPatternForContainer):
1947         Adopt sinkIntoImage and drawConsumingImageBuffer in a few places.
1948
1949 2015-12-13  Andreas Kling  <akling@apple.com>
1950
1951         CachedScript could have a copy-free path for all-ASCII scripts.
1952         <https://webkit.org/b/152203>
1953
1954         Reviewed by ANtti Koivisto.
1955
1956         Many (if not most) of script resources on the web contain nothing but ASCII characters.
1957         Such resources, when streamed through a text decoder, will yield the exact same byte
1958         sequence, except in anonymous heap memory instead of delicious file-backed pages.
1959
1960         Care is taken to ensure that the wrapper StringImpl is updated to target newly cached
1961         resource data if an asynchronous caching notification comes in.
1962
1963         * loader/cache/CachedResource.cpp:
1964         (WebCore::CachedResource::tryReplaceEncodedData):
1965         * loader/cache/CachedResource.h:
1966         (WebCore::CachedResource::didReplaceSharedBufferContents):
1967         * loader/cache/CachedScript.cpp:
1968         (WebCore::encodingMayBeAllASCII):
1969         (WebCore::CachedScript::script):
1970         (WebCore::CachedScript::didReplaceSharedBufferContents):
1971         * loader/cache/CachedScript.h:
1972         * platform/SharedBuffer.h:
1973         * platform/cf/SharedBufferCF.cpp:
1974         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer):
1975
1976 2015-12-13  Zalan Bujtas  <zalan@apple.com>
1977
1978         Clean up absolute positioned map properly.
1979         https://bugs.webkit.org/show_bug.cgi?id=152219
1980         rdar://problem/23861165
1981
1982         Reviewed by Simon Fraser.
1983
1984         We insert positioned renderers into a static map (RenderBlock::gPositionedDescendantsMap) to keep track of them.
1985         Since this static map is at block level, (positioned)inline renderers use their containing block to store
1986         their positioned descendants.
1987         This patch ensures that when an inline element can no longer hold positioned children, we remove them from
1988         the inline's containing block's map. -unless the container itself can hold positioned renderers(see RenderElement::canContainAbsolutelyPositionedObjects).
1989
1990         Test: fast/block/positioning/crash-when-positioned-inline-has-positioned-child.html
1991
1992         * rendering/RenderInline.cpp:
1993         (WebCore::RenderInline::styleWillChange):
1994         * rendering/RenderInline.h:
1995
1996 2015-12-13  Joanmarie Diggs  <jdiggs@igalia.com>
1997
1998         AX: [EFL] Anonymous render block flow elements should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL
1999         https://bugs.webkit.org/show_bug.cgi?id=152079
2000
2001         Reviewed by Chris Fleizach.
2002
2003         Map the element to WebCore AccessibilityRole DivRole for EFL. As with GTK, this
2004         is being done in the shared layer rather than in the platform layer because we
2005         want all subsequent logic to treat anonymous render block flow elements as divs.
2006
2007         No new tests. We already have sufficient test coverage. The expectations
2008         been updated accordingly.
2009
2010         * accessibility/AccessibilityRenderObject.cpp:
2011         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2012
2013 2015-12-12  Brady Eidson  <beidson@apple.com>
2014
2015         Modern IDB: storage/indexeddb/index-duplicate-keypaths.html fails.
2016         https://bugs.webkit.org/show_bug.cgi?id=152201
2017
2018         Reviewed by Alex Christensen.
2019
2020         No new tests (At least one failing test now passes).
2021         
2022         The spec states that if an object store uses a key generator, and then a record is stored whose
2023         key was an explicitly set number, then the key generator value should be bumped to the next
2024         integer higher than the explicit number.
2025         
2026         We didn't do that.
2027         
2028         Now we do.
2029
2030         * Modules/indexeddb/IndexedDB.h: Add an "OverwriteForCursor" option for overwrite mode.
2031         
2032         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2033         (WebCore::IDBClient::IDBObjectStore::putForCursorUpdate): Use the "OverwriteForCursor" mode.
2034                 
2035         * Modules/indexeddb/server/IDBBackingStore.h: Add maybeUpdateKeyGeneratorNumber
2036
2037         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2038         (WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber): If the number value
2039           from the provided key should bump the key generator value, do so now.
2040         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2041
2042         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2043         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): After successfully adding the new record,
2044           possibly bump the key generator value.
2045
2046 2015-12-12  Katlyn Graff  <kgraff@apple.com>
2047
2048         Safari background tabs should be fully suspended where possible.
2049         https://bugs.webkit.org/show_bug.cgi?id=150515
2050
2051         Reviewed by Ryosuke Niwa.
2052
2053         Support for tab suspension for Mac, enabled by defaults writing to WebKitTabSuspension.
2054         Page-down suspension consolidated with PageCache suspension code in Document::
2055         suspend and Document::resume. Pages canTabSuspend if cacheable, nonvisible, nonprerender,
2056         and nonactive.
2057
2058         * dom/Document.cpp: moved scrollbar handling from setInPageCache to suspend/resume
2059         (WebCore::Document::suspend): moved scrollbar, dom, animation, timer, and visual update suspending into here
2060         (WebCore::Document::resume): moved scrollbar, dom, animation, timer, and visual update resuming into here
2061         * dom/Document.h: added m_isSuspended to prevent repeat calls from PageCache/Tab Suspension contention
2062         * history/CachedFrame.cpp: moved dom, animation, and timer suspension into Document::suspend
2063         (WebCore::CachedFrame::CachedFrame):
2064        * history/PageCache.cpp: Added a few nullchecks to prevent crashes if canCacheFrame is called but document is null
2065         (WebCore::PageCache::canCacheFrame):
2066         * page/Page.cpp:
2067         (WebCore::Page::Page): Added timer to fire delayed suspension
2068         (WebCore::Page::setPageActivityState): Added a call to schedule tab suspension
2069         (WebCore::Page::setIsVisibleInternal): Added a call to schedule tab suspension
2070         (WebCore::Page::canTabSuspend): Added support for suspending if cacheable, nonvisible, nonprerender, and nonactive
2071         (WebCore::Page::setIsTabSuspended): Added a function to suspend or resume tabs
2072         (WebCore::Page::setTabSuspensionEnabled): Added support for a defaults write enable
2073         (WebCore::Page::scheduleTabSuspension): Added ability to schedule the suspension timer to fire or resume
2074         (WebCore::Page::timerFired): Added a suspension timer
2075         * page/Page.h:
2076         * page/PageThrottler.h:
2077         (WebCore::PageThrottler::activityState): Added access to m_activityState for canTabSuspend
2078
2079 2015-12-11  Simon Fraser  <simon.fraser@apple.com>
2080
2081         Mousewheel events don't work in iframes in RTL documents
2082         https://bugs.webkit.org/show_bug.cgi?id=152200
2083
2084         Reviewed by Beth Dakin.
2085         
2086         When dispatching wheel events, the testing of the event point against the
2087         non-fast scrollable region was broken in an RTL document. Fix by taking
2088         the scrollOrigin into account in ScrollingTreeFrameScrollingNode::viewToContentsOffset().
2089
2090         Test: fast/scrolling/rtl-point-in-iframe.html
2091
2092         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2093         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset):
2094
2095 2015-12-11  Zalan Bujtas  <zalan@apple.com>
2096
2097         ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
2098         https://bugs.webkit.org/show_bug.cgi?id=151201
2099
2100         Reviewed by Simon Fraser.
2101
2102         Drawing empty rect is a waste.
2103
2104         Test: fast/borders/empty-drawrect-assert-after-pixelsnap.html
2105
2106         * rendering/RenderElement.cpp:
2107         (WebCore::RenderElement::drawLineForBoxSide):
2108
2109 2015-12-11  Jiewen Tan  <jiewen_tan@apple.com>
2110
2111         Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
2112         https://bugs.webkit.org/show_bug.cgi?id=152102
2113         <rdar://problem/22124230>
2114
2115         Reviewed by Andy Estes.
2116
2117         Keep the ReferrerPolicy for a document as ReferrerPolicyNever if the document is loaded with
2118         "Content-Disposition: attachment".
2119
2120         Test: http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html
2121
2122         * dom/Document.cpp:
2123         (WebCore::Document::processReferrerPolicy):
2124         (WebCore::Document::applyContentDispositionAttachmentSandbox):
2125
2126 2015-12-11  Eric Carlson  <eric.carlson@apple.com>
2127
2128         [MediaStream] Add a setting to allow the mock media capture devices to be enabled and disabled
2129         https://bugs.webkit.org/show_bug.cgi?id=152197
2130
2131         Reviewed by Dean Jackson.
2132
2133         Test: fast/mediastream/mock-media-source.html
2134
2135         * page/Settings.cpp:
2136         (WebCore::Settings::mockCaptureDevicesEnabled):
2137         (WebCore::Settings::setMockCaptureDevicesEnabled):
2138         * page/Settings.h:
2139
2140         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
2141         (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenterOverride): Renamed.
2142         (WebCore::RealtimeMediaSourceCenter::setSharedStreamCenter): Deleted.
2143         * platform/mediastream/RealtimeMediaSourceCenter.h:
2144
2145         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2146         (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): Renamed. Allow
2147           it to be enabled and disabled.
2148         (WebCore::MockRealtimeMediaSourceCenter::registerMockRealtimeMediaSourceCenter): Deleted.
2149         * platform/mock/MockRealtimeMediaSourceCenter.h:
2150
2151         * testing/Internals.cpp:
2152         (WebCore::Internals::Internals):
2153         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
2154         * testing/Internals.h:
2155         * testing/Internals.idl:
2156
2157 2015-12-11  Jer Noble  <jer.noble@apple.com>
2158
2159         [EME] Do not pass in the initialization data to AVContentKeyRequest as the contentIdentifier.
2160         https://bugs.webkit.org/show_bug.cgi?id=152204
2161         rdar://problem/23867877
2162
2163         Reviewed by Eric Carlson.
2164
2165         The AVContentKeyRequest API has been updated to no longer require a contentId parameter if the
2166         ID can be derived from the initialization data.
2167
2168         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2169         (WebCore::CDMSessionAVContentKeySession::update):
2170
2171 2015-12-11  Alexey Proskuryakov  <ap@apple.com>
2172
2173         Roll out http://trac.webkit.org/r193984, because the new test is timing out.
2174
2175         Was: Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
2176         https://bugs.webkit.org/show_bug.cgi?id=152102
2177         <rdar://problem/22124230>
2178
2179         * dom/Document.cpp:
2180         (WebCore::Document::processReferrerPolicy):
2181         (WebCore::Document::applyContentDispositionAttachmentSandbox):
2182
2183 2015-12-11  Brady Eidson  <beidson@apple.com>
2184
2185         Modern IDB: storage/indexeddb/optional-arguments.html fails.
2186         https://bugs.webkit.org/show_bug.cgi?id=152194
2187
2188         Reviewed by Alex Christensen.
2189
2190         No new tests (At least one failing test now passes).
2191
2192         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2193         (WebCore::IDBClient::IDBCursor::continueFunction): Allow 'undefined' for the key.
2194         
2195         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2196         (WebCore::IDBClient::IDBObjectStore::add): Ditto.
2197         (WebCore::IDBClient::IDBObjectStore::put): Ditto.
2198
2199 2015-12-11  Brady Eidson  <beidson@apple.com>
2200
2201         Followup to:
2202         Modern IDB: storage/indexeddb/index-count.html fails.
2203         https://bugs.webkit.org/show_bug.cgi?id=152175
2204
2205         Noticed by Darin Adler.
2206
2207         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2208         (WebCore::IDBClient::IDBIndex::count): Replace a curly brace to its proper place.
2209
2210 2015-12-11  Brady Eidson  <beidson@apple.com>
2211
2212         Modern IDB: storage/indexeddb/cursor-continue.html fails.
2213         https://bugs.webkit.org/show_bug.cgi?id=152192
2214
2215         Reviewed by Alex Christensen.
2216
2217         No new tests (At least one failing test now passes).
2218
2219         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2220         (WebCore::IDBClient::IDBCursor::continueFunction): Check against the current key, not the current primary key.
2221         (WebCore::IDBClient::IDBCursor::setGetResult): Also save off the current IDBKeyData.
2222         * Modules/indexeddb/client/IDBCursorImpl.h:
2223
2224 2015-12-11  Brady Eidson  <beidson@apple.com>
2225
2226         Modern IDB: storage/indexeddb/index-basics.html fails.
2227         https://bugs.webkit.org/show_bug.cgi?id=152190
2228
2229         Reviewed by Alex Christensen.
2230
2231         No new tests (At least one failing test now passes).
2232
2233         * bindings/js/JSIDBObjectStoreCustom.cpp:
2234         (WebCore::JSIDBObjectStore::createIndex): Custom error message for the TypeError
2235
2236 2015-12-11  Jiewen Tan  <jiewen_tan@apple.com>
2237
2238         Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"
2239         https://bugs.webkit.org/show_bug.cgi?id=152102
2240         <rdar://problem/22124230>
2241
2242         Reviewed by Andy Estes.
2243
2244         Keep the ReferrerPolicy for a document as ReferrerPolicyNever if the document is loaded with
2245         "Content-Disposition: attachment".
2246
2247         Test: http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html
2248
2249         * dom/Document.cpp:
2250         (WebCore::Document::processReferrerPolicy):
2251         (WebCore::Document::applyContentDispositionAttachmentSandbox):
2252
2253 2015-12-11  Brady Eidson  <beidson@apple.com>
2254
2255         Modern IDB: storage/indexeddb/key-type-array.html fails.
2256         https://bugs.webkit.org/show_bug.cgi?id=152187
2257
2258         Reviewed by Alex Christensen.
2259
2260         No new tests (At least one failing test now passes).
2261
2262         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2263         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Perform the correct validity check on array keys.
2264
2265 2015-12-11  Joseph Pecoraro  <pecoraro@apple.com>
2266
2267         check-for-inappropriate-objc-class-names should check all class names, not just externally visible ones
2268         https://bugs.webkit.org/show_bug.cgi?id=152156
2269
2270         Reviewed by Dan Bernstein.
2271
2272         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2273         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2274         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
2275         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2276         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2277         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
2278         Rename classes with a "Web" prefix.
2279
2280 2015-12-11  Brady Eidson  <beidson@apple.com>
2281
2282         Modern IDB: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html fails.
2283         https://bugs.webkit.org/show_bug.cgi?id=152177
2284
2285         Reviewed by Alex Christensen.
2286
2287         No new tests (At least one failing test now passes).
2288
2289         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2290         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionDidFinish): Renamed from below.
2291         (WebCore::IDBClient::IDBOpenDBRequest::versionChangeTransactionWillFinish): Deleted.
2292         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2293         
2294         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2295         (WebCore::IDBClient::IDBRequest::setVersionChangeTransaction): OpenDBRequests usually don't have transactions, 
2296           unless they end up being upgrade requests.
2297         * Modules/indexeddb/client/IDBRequestImpl.h:
2298         
2299         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2300         (WebCore::IDBClient::IDBTransaction::IDBTransaction): Call setVersionChangeTransaction on the request if appropriate.
2301         (WebCore::IDBClient::IDBTransaction::dispatchEvent): Call versionChangeTransactionDidFinish after the 
2302           abort/complete events fire.
2303         (WebCore::IDBClient::IDBTransaction::abort): Deleted.
2304         (WebCore::IDBClient::IDBTransaction::commit): Deleted.
2305
2306 2015-12-11  Brady Eidson  <beidson@apple.com>
2307
2308         Modern IDB: storage/indexeddb/index-count.html fails.
2309         https://bugs.webkit.org/show_bug.cgi?id=152175
2310
2311         Reviewed by Alex Christensen.
2312
2313         No new tests (At least one failing test now passes).
2314
2315         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2316         (WebCore::IDBClient::IDBIndex::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
2317         (WebCore::IDBClient::IDBIndex::doCount): Change an isNull check to a more correct !isValid() check.
2318
2319 2015-12-11  Per Arne Vollan  <peavo@outlook.com>
2320
2321         [WinCairo][MediaFoundation] Setting playback rate does not work.
2322         https://bugs.webkit.org/show_bug.cgi?id=152172
2323
2324         Reviewed by Brent Fulgham.
2325
2326         Implement method to set playback rate.
2327
2328         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2329         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble):
2330         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble):
2331         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble):
2332         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2333
2334 2015-12-11  Darin Adler  <darin@apple.com>
2335
2336         Reduce the number of events that can be created by Document.createEvent
2337         https://bugs.webkit.org/show_bug.cgi?id=151931
2338
2339         Reviewed by Alex Christensen.
2340
2341         Document.createEvent is intended for use only with a certain set of legacy events.
2342         Ideally it should only be the ones mentioned in the DOM specification.
2343
2344         For now, at least remove all the events that can't usefully be created and initialized
2345         this way. Later, we should cut it down even smaller. And stop automatically generating
2346         this, which was causing everyone who made an event IDL file to get supported here!
2347
2348         The modern alternative is to use event class constructors instead.
2349
2350         * CMakeLists.txt: Don't compile EventFactory.cpp. For now, we still generate
2351         EventFactory.cpp but we do not use it.
2352         * DerivedSources.make: Ditto.
2353         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
2354         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2355         * WebCore.xcodeproj/project.pbxproj: Ditto. Also don't include EventFactory.h in the
2356         project file.
2357
2358         * dom/DOMImplementation.cpp:
2359         (WebCore::DOMImplementation::hasFeature): Added a comment about the SVGZoomEvents feature.
2360
2361         * dom/Document.cpp: Re-sorted includes and added the new ones needed for createEvent.
2362         (WebCore::Document::createEvent): Moved all the logic here from EventFactory, and
2363         took a crack at comments that explain what this should and should not be used for.
2364
2365         * dom/EventFactory.h: Removed.
2366
2367 2015-12-10  Brady Eidson  <beidson@apple.com>
2368
2369         Modern IDB: storage/indexeddb/objectstore-count.html fails.
2370         https://bugs.webkit.org/show_bug.cgi?id=152167
2371
2372         Reviewed by Alex Christensen.
2373
2374         No new tests (At least one failing test now passes).
2375
2376         * Modules/indexeddb/IDBKeyRangeData.h:
2377         (WebCore::IDBKeyRangeData::allKeys):
2378         
2379         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2380         (WebCore::IDBClient::IDBObjectStore::count): If the passed in IDBKeyRange* is nullptr, use IDBKeyRangeData::allKeys.
2381         (WebCore::IDBClient::IDBObjectStore::doCount): Change an isNull check to a more correct !isValid() check.
2382
2383 2015-12-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2384
2385         Binding and builtin generators should lowercase RTCXX as rtcXX and not rTCXX
2386         https://bugs.webkit.org/show_bug.cgi?id=152121
2387
2388         Reviewed by Darin Adler.
2389
2390         No change in behavior.
2391
2392         * bindings/js/JSDOMWindowBase.cpp:
2393         (WebCore::JSDOMWindowBase::finishCreation): Using rtcXX in lieu of rTCXX.
2394         * bindings/js/WebCoreJSBuiltinInternals.h:
2395         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions): Ditto.
2396         (WebCore::JSBuiltinInternalFunctions::rtcPeerConnectionInternals): Added.
2397         (WebCore::JSBuiltinInternalFunctions::visit): Ditto.
2398         (WebCore::JSBuiltinInternalFunctions::init): Ditto.
2399         (WebCore::JSBuiltinInternalFunctions::rTCPeerConnectionInternals): Deleted.
2400         * bindings/js/WebCoreJSBuiltins.h:
2401         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions): Using rtcXX in lieu of rTCXX.
2402         (WebCore::JSBuiltinFunctions::rtcPeerConnectionBuiltins): Added.
2403         (WebCore::JSBuiltinFunctions::rtcPeerConnectionInternalsBuiltins): Added.
2404         (WebCore::JSBuiltinFunctions::rTCPeerConnectionBuiltins): Deleted.
2405         (WebCore::JSBuiltinFunctions::rTCPeerConnectionInternalsBuiltins): Deleted.
2406         * bindings/scripts/CodeGenerator.pm:
2407         (WK_lcfirst): Added RTC special rule.
2408
2409 2015-12-10  Zalan Bujtas  <zalan@apple.com>
2410
2411         ASSERTION FAILED: !simpleLineLayout() in WebCore::RenderText::collectSelectionRectsForLineBoxes
2412         https://bugs.webkit.org/show_bug.cgi?id=152115
2413
2414         Reviewed by Simon Fraser.
2415
2416         document.execCommand("indent") generates a blockquote wrapper and moves the indented content inside.
2417         If the indented content is already inside a selection, we need to make sure that newly created flow uses
2418         normal line layout.
2419         This patch fixes the generic case as re-parenting an already selected renderer is not specific to document.execCommand("indent").
2420
2421         Test: fast/block/selection-inside-simple-line-layout.html
2422
2423         * rendering/SimpleLineLayout.cpp:
2424         (WebCore::SimpleLineLayout::canUseForWithReason):
2425         (WebCore::SimpleLineLayout::printReason):
2426
2427 2015-12-10  Eric Carlson  <eric.carlson@apple.com>
2428
2429         [MediaStream] Expose media capture devices persistent permissions to WebCore
2430         https://bugs.webkit.org/show_bug.cgi?id=152087
2431
2432         Reviewed by Chris Dumez.
2433
2434         No new tests, an existing test was updated to test the change.
2435
2436         * CMakeLists.txt: Add UserMediaPermissionCheck.cpp.
2437
2438         * Modules/mediastream/MediaDevicesRequest.cpp:
2439         (WebCore::MediaDevicesRequest::~MediaDevicesRequest): Clear the permission checker client.
2440         (WebCore::MediaDevicesRequest::contextDestroyed): Ditto.
2441         (WebCore::MediaDevicesRequest::start): Create a permission checker and start it running.
2442         (WebCore::MediaDevicesRequest::didCompleteCheck): Start the media source checker.
2443         (WebCore::MediaDevicesRequest::didCompleteRequest): Only include a track's label if the
2444           page has permission to use a capture device.
2445         * Modules/mediastream/MediaDevicesRequest.h:
2446
2447         * Modules/mediastream/UserMediaClient.h: Include prototypes for permission checker.
2448         (WebCore::UserMediaClient::~UserMediaClient):
2449         
2450         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp: Removed, not longer used.
2451         * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
2452
2453         * Modules/mediastream/UserMediaController.h:
2454         (WebCore::UserMediaController::checkUserMediaPermission): New.
2455         (WebCore::UserMediaController::cancelUserMediaPermissionCheck): Ditto.
2456
2457         * Modules/mediastream/UserMediaPermissionCheck.cpp: Added.
2458         (WebCore::UserMediaPermissionCheck::create):
2459         (WebCore::UserMediaPermissionCheck::UserMediaPermissionCheck):
2460         (WebCore::UserMediaPermissionCheck::~UserMediaPermissionCheck):
2461         (WebCore::UserMediaPermissionCheck::securityOrigin):
2462         (WebCore::UserMediaPermissionCheck::contextDestroyed):
2463         (WebCore::UserMediaPermissionCheck::start):
2464         (WebCore::UserMediaPermissionCheck::setDeviceAccessMode):
2465         * Modules/mediastream/UserMediaPermissionCheck.h: Added.
2466         (WebCore::UserMediaPermissionCheckClient::~UserMediaPermissionCheckClient):
2467         (WebCore::UserMediaPermissionCheck::setClient):
2468
2469         * WebCore.xcodeproj/project.pbxproj: Add UserMediaPermissionCheck.cpp|.h
2470
2471         * platform/mock/UserMediaClientMock.h: Removed, it is no longer used.
2472
2473         * testing/Internals.cpp: Remove UserMediaClientMock.h include, it is gone.
2474
2475 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
2476
2477         Build fix
2478
2479         Unreviewed.
2480
2481         * platform/graphics/cocoa/FontCocoa.mm:
2482         (WebCore::smallCapsTrueTypeDictionary):
2483
2484 2015-12-10  Simon Fraser  <simon.fraser@apple.com>
2485
2486         Mordernize viewport dumping
2487         https://bugs.webkit.org/show_bug.cgi?id=152159
2488
2489         Reviewed by Zalan Bujtas.
2490
2491         Use groupings to simplify the viewport configuration dumping code.
2492
2493         * page/ViewportConfiguration.cpp:
2494         (WebCore::operator<<):
2495         (WebCore::ViewportConfiguration::description):
2496
2497 2015-12-10  Joseph Pecoraro  <pecoraro@apple.com>
2498
2499         Remote Inspector: Verify the identity of the other side of XPC connections
2500         https://bugs.webkit.org/show_bug.cgi?id=152153
2501
2502         Reviewed by Brian Burg.
2503
2504         * WebCore.xcodeproj/project.pbxproj:
2505         * platform/network/mac/CertificateInfoMac.mm:
2506         Use the new header.
2507
2508 2015-12-10  Brady Eidson  <beidson@apple.com>
2509
2510         Modern IDB: storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange.html fails
2511         https://bugs.webkit.org/show_bug.cgi?id=152144
2512
2513         Reviewed by Alex Christensen.
2514
2515         No new tests (At least two failing tests now pass, and other incorrect tests updated to be more correct).
2516
2517         - An IDBOpenDBRequest resulting in a versionchange transaction should not have the onsuccess event fire if 
2518           the database connection was closed during the versionchange transaction. onerror should fire instead.
2519         - When firing an event at an IDBRequest, it should not have the transaction as an additional target if the
2520           transaction has finished.
2521         - When firing an event at an IDBRequest, it should not have the database as an additional target if the
2522           database is closed or is closing.
2523
2524         * Modules/indexeddb/client/IDBDatabaseImpl.h:
2525         (WebCore::IDBClient::IDBDatabase::isClosingOrClosed):
2526         
2527         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2528         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
2529         (WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort): Deleted.
2530         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2531         
2532         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2533         (WebCore::IDBClient::IDBRequest::dispatchEvent): Don't add finished transactions or closed databases as event targets.
2534         
2535         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2536         (WebCore::IDBClient::IDBTransaction::notifyDidAbort):
2537         (WebCore::IDBClient::IDBTransaction::dispatchEvent): If this was a versionchange transaction completing, possibly fire
2538           the error event on the OpenDBRequest instead of the success event.
2539         * Modules/indexeddb/client/IDBTransactionImpl.h:
2540         (WebCore::IDBClient::IDBTransaction::isFinished):
2541
2542 2015-12-10  Zalan Bujtas  <zalan@apple.com>
2543
2544         Simple line layout: Use TextPainter to draw simple line text.
2545         https://bugs.webkit.org/show_bug.cgi?id=152150
2546
2547         Reviewed by Simon Fraser.
2548
2549         No change in functionality.
2550
2551         * rendering/SimpleLineLayoutFunctions.cpp:
2552         (WebCore::SimpleLineLayout::paintFlow):
2553         * rendering/TextPainter.h:
2554
2555 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
2556
2557         [Font Features] r193894 introduces leaks
2558         https://bugs.webkit.org/show_bug.cgi?id=152154
2559
2560         Reviewed by Joe Pecoraro.
2561
2562         * platform/graphics/cocoa/FontCocoa.mm:
2563         (WebCore::smallCapsTrueTypeDictionary):
2564         (WebCore::createCTFontWithoutSynthesizableFeatures):
2565
2566 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
2567
2568         Build fix
2569
2570         Unreviewed.
2571
2572         * platform/graphics/cocoa/FontCocoa.mm:
2573         (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
2574
2575 2015-12-10  Zalan Bujtas  <zalan@apple.com>
2576
2577         TextPainter: Add support for painting multiple text runs.
2578         https://bugs.webkit.org/show_bug.cgi?id=152148
2579
2580         Reviewed by Simon Fraser.
2581
2582         This is in preparation for adding simple line layout as a client.
2583
2584         No change in functionality.
2585
2586         * rendering/InlineTextBox.cpp:
2587         (WebCore::drawSkipInkUnderline): Decouple underline skipping intersection calculation and text painter.
2588         (WebCore::InlineTextBox::paint):
2589         (WebCore::InlineTextBox::paintDecoration):
2590         * rendering/InlineTextBox.h:
2591         * rendering/TextPainter.cpp:
2592         (WebCore::TextPainter::TextPainter):
2593         (WebCore::TextPainter::paintTextWithShadows):
2594         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2595         (WebCore::TextPainter::paintText):
2596         (WebCore::TextPainter::dashesForIntersectionsWithRect): Deleted.
2597         * rendering/TextPainter.h:
2598         (WebCore::TextPainter::setTextPaintStyle):
2599         (WebCore::TextPainter::setSelectionPaintStyle):
2600         (WebCore::TextPainter::setIsHorizontal):
2601         (WebCore::TextPainter::setFont):
2602         (WebCore::TextPainter::addEmphasis):
2603         (WebCore::TextPainter::addTextShadow):
2604
2605 2015-12-10  Enrica Casucci  <enrica@apple.com>
2606
2607         Change skin tone support for two emoji.
2608         https://bugs.webkit.org/show_bug.cgi?id=152147
2609         rdar://problem/23716993
2610         rdar://problem/23716344
2611
2612         Reviewed by Darin Adler.
2613
2614         Horse race emoji (1F3C7) should no longer have skin tone variation.
2615         Sleuth/Spy emoji (!F575) should instead have skin tone variation.
2616
2617         * platform/text/TextBreakIterator.cpp:
2618         (WebCore::cursorMovementIterator):
2619
2620 2015-12-10  Commit Queue  <commit-queue@webkit.org>
2621
2622         Unreviewed, rolling out r193500.
2623         https://bugs.webkit.org/show_bug.cgi?id=152143
2624
2625         do not want to have to disable canvas-to-large-to-draw test
2626         (Requested by bfulgham on #webkit).
2627
2628         Reverted changeset:
2629
2630         "Place an upper bound on canvas pixel count"
2631         https://bugs.webkit.org/show_bug.cgi?id=151825
2632         http://trac.webkit.org/changeset/193500
2633
2634 2015-12-10  Brady Eidson  <beidson@apple.com>
2635
2636         Followup for:
2637         Modern IDB: storage/indexeddb/intversion-close-between-events.html fails.
2638         https://bugs.webkit.org/show_bug.cgi?id=152096
2639
2640         Implementing Darin Adler's review feedback that came after the patch landed.
2641
2642         * bindings/js/JSIDBDatabaseCustom.cpp:
2643         (WebCore::JSIDBDatabase::transaction): No need to explicitly cast to Vector<String>.
2644
2645 2015-12-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2646
2647         JSC Builtins should use safe array methods
2648         https://bugs.webkit.org/show_bug.cgi?id=151501
2649
2650         Reviewed by Darin Adler.
2651
2652         Using @push and @shift in internal arrays in lieu of push and shift.
2653         This cannot be disrupted by user scripts except if arrays are also made accessible to user scripts.
2654
2655         Covered by added tests for ReadableStream constructs.
2656
2657         * Modules/mediastream/RTCPeerConnectionInternals.js:
2658         (runNext):
2659         (enqueueOperation):
2660         * Modules/streams/ReadableStreamInternals.js:
2661         (enqueueInReadableStream):
2662         (readFromReadableStreamReader):
2663         * Modules/streams/StreamInternals.js:
2664         (dequeueValue):
2665         (enqueueValueWithSize):
2666
2667 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
2668
2669         [TexMap] pixel coverage multiplication in TiledBackingStore can overflow
2670         https://bugs.webkit.org/show_bug.cgi?id=152055
2671
2672         Reviewed by Carlos Garcia Campos.
2673
2674         The computation of the pixel coverage in TiledBackingStore can easily overflow
2675         when the candidate size is relatively large (for instance when the backed
2676         layer is transformed in a way that increases its perceived size). This can result
2677         in missing tiles for this specific backing store, at least until the layer in
2678         question is transformed again into a shape that produces a smaller candidate size.
2679
2680         To avoid the integer overflow, the multiplication is done in a safe manner,
2681         defaulting to the max positive value an integer can hold in case the overflow
2682         is detected.
2683
2684         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2685         (WebCore::TiledBackingStore::adjustForContentsRect):
2686
2687 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
2688
2689         [TexMap] Clean up BitmapTexturePool
2690         https://bugs.webkit.org/show_bug.cgi?id=152073
2691
2692         Reviewed by Daniel Bates.
2693
2694         Move BitmapTexturePoolEntry class under the BitmapTexturePool class, renaming
2695         it to simply Entry and keeping it private. Have the constructor take in an
2696         rvalue reference to the RefPtr<BitmapTexture> object. Remove the static
2697         compareTimeLastUsed() function and use a lambda directly in its place.
2698
2699         Remove the default BitmapTexturePool constructor, which isn't used anywhere.
2700         Have the constructor and some methods accept or return RefPtr objects, possibly
2701         via rvalue references. Clean up the header file by removing a few unnecessary
2702         header includes and using forward declarations where possible.
2703
2704         In the BitmapTexturePool implementation file, mark the two const variables as
2705         static. The ::acquireTexture() method now uses the std::find_if() algorithm
2706         to find a fitting Entry object in the Vector. The same method is also moved
2707         upwards so we follow the order of declaration in the header. ::createTexture()
2708         inlines the return of the new expression into the adoptRef() call in the return
2709         statement.
2710
2711         TextureMapperGL constructor is updated to pass a copied RefPtr object into the
2712         BitmapTexturePool constructor.
2713
2714         * platform/graphics/texmap/BitmapTexturePool.cpp:
2715         (WebCore::BitmapTexturePool::BitmapTexturePool):
2716         (WebCore::BitmapTexturePool::acquireTexture):
2717         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2718         (WebCore::BitmapTexturePool::createTexture):
2719         * platform/graphics/texmap/BitmapTexturePool.h:
2720         (WebCore::BitmapTexturePool::Entry::Entry):
2721         (WebCore::BitmapTexturePool::Entry::markUsed):
2722         (WebCore::BitmapTexturePoolEntry::BitmapTexturePoolEntry): Deleted.
2723         (WebCore::BitmapTexturePoolEntry::markUsed): Deleted.
2724         (WebCore::BitmapTexturePoolEntry::compareTimeLastUsed): Deleted.
2725         * platform/graphics/texmap/TextureMapperGL.cpp:
2726         (WebCore::TextureMapperGL::TextureMapperGL):
2727
2728 2015-12-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2729
2730         [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts
2731         https://bugs.webkit.org/show_bug.cgi?id=151533
2732
2733         Reviewed by Carlos Garcia Campos.
2734
2735         Remove the style context cache to simplify the code, drastically reduce the number of
2736         expensive save/restore operations performed on style contexts, and avoid unwanted
2737         side-effects in RenderThemeGtk::styleColor. This is also a speculative fix for improper
2738         button rendering with certain custom themes, and a simplification that will make it easier
2739         to fix bug #150550.
2740
2741         This change does have performance implications, which I intend to check on the perf bot
2742         after landing to ensure that removing the cache does not have a significant negative impact
2743         on performance; I have no clue whether this will be a net performance win or loss. However,
2744         this is a bit tricky, because the bot is running GTK+ 3.16, whereas I expect save/restore
2745         might be much more expensive in GTK+ 3.20, and I do not want to make performance decisions
2746         except based on the latest GTK+ due to large changes in the implementation of
2747         GtkStyleContext.
2748
2749         * rendering/RenderThemeGtk.cpp:
2750         (WebCore::createStyleContext):
2751         (WebCore::getStockIconForWidgetType):
2752         (WebCore::getStockSymbolicIconForWidgetType):
2753         (WebCore::RenderThemeGtk::initMediaColors):
2754         (WebCore::RenderThemeGtk::adjustRepaintRect):
2755         (WebCore::setToggleSize):
2756         (WebCore::paintToggle):
2757         (WebCore::RenderThemeGtk::setCheckboxSize):
2758         (WebCore::RenderThemeGtk::setRadioSize):
2759         (WebCore::RenderThemeGtk::paintButton):
2760         (WebCore::getComboBoxMetrics):
2761         (WebCore::RenderThemeGtk::paintMenuList):
2762         (WebCore::RenderThemeGtk::paintTextField):
2763         (WebCore::RenderThemeGtk::paintSliderTrack):
2764         (WebCore::RenderThemeGtk::paintSliderThumb):
2765         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
2766         (WebCore::RenderThemeGtk::paintProgressBar):
2767         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2768         (WebCore::RenderThemeGtk::paintInnerSpinButton):
2769         (WebCore::styleColor):
2770         (WebCore::gtkStyleChangedCallback): Deleted.
2771         (WebCore::styleContextMap): Deleted.
2772         (WebCore::getStyleContext): Deleted.
2773
2774 2015-12-10  Myles C. Maxfield  <mmaxfield@apple.com>
2775
2776         font-variant-caps does not work if the font does not support font features
2777         https://bugs.webkit.org/show_bug.cgi?id=149774
2778
2779         Reviewed by Antti Koivisto.
2780
2781         This test implements synthesis for small-caps and all-small-caps. It does so by
2782         moving font variant selection into a higher level (ComplexTextController).
2783         In general, the approach is to use the pure font feature until we encounter
2784         a character which needs to be uppercased, and which the font feature does not
2785         support uppercasing. In this situation, we try again with synthesis. In this
2786         case, synthesis means artificially uppercasing letters and rendering them with
2787         a smaller font.
2788
2789         We require system support to know which glyphs a particular font feature supports.
2790         Therefore, on operating systems which do not include this support, we will simply
2791         say that the font feature does not support any glyphs.
2792
2793         Test: css3/font-variant-small-caps-synthesis.html
2794               css3/font-variant-petite-caps-synthesis.html
2795
2796         * platform/graphics/Font.cpp:
2797         (WebCore::Font::noSmallCapsFont): Return the same font, but without smcp or c2sc.
2798         This function utilizes a cache.
2799         * platform/graphics/Font.h:
2800         (WebCore::Font::variantFont): Small caps should never go through this function
2801         anymore.
2802         * platform/graphics/FontCascade.h: Because we're moving variant selection into
2803         a higher level, we remove the FontVariant argument from the lower-level call.
2804         * platform/graphics/FontCascadeFonts.cpp:
2805         (WebCore::FontCascadeFonts::glyphDataForVariant): Use early-return style.
2806         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Ditto.
2807         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2808         (WebCore::FontCascade::fontForCombiningCharacterSequence): Because we're moving
2809         variant selection into a higher level, we remove the FontVariant argument from
2810         the lower-level call.
2811         * platform/graphics/cocoa/FontCocoa.mm:
2812         (WebCore::Font::smallCapsSupportsCharacter):
2813         (WebCore::Font::allSmallCapsSupportsCharacter):
2814         (WebCore::smallCapsOpenTypeDictionary): Helper function for
2815         smallCapsSupportsCharacter().
2816         (WebCore::smallCapsTrueTypeDictionary): Ditto.
2817         (WebCore::unionBitVectors):
2818         (WebCore::Font::glyphsSupportedBySmallCaps): Compute a bit vector of supported
2819         glyphs.
2820         (WebCore::Font::glyphsSupportedByAllSmallCaps): Ditto.
2821         (WebCore::createDerivativeFont): Moving common code into its own helper function.
2822         (WebCore::Font::createFontWithoutSmallCaps):
2823         (WebCore::Font::platformCreateScaledFont): Use the common code.
2824         * platform/graphics/mac/ComplexTextController.cpp:
2825         (WebCore::capitalized): What is the capitalized form of a character?
2826         (WebCore::ComplexTextController::collectComplexTextRuns): Implement the core
2827         logic of this patch. This includes the retry when we encounter a character which
2828         is not supported by the font feature.
2829         * platform/spi/cocoa/CoreTextSPI.h:
2830
2831 2015-12-10  Zan Dobersek  <zdobersek@igalia.com>
2832
2833         [TexMap] Remove the TEXMAP_OPENGL_ES_2 define
2834         https://bugs.webkit.org/show_bug.cgi?id=152069
2835
2836         Reviewed by Alex Christensen.
2837
2838         Remove the TEXMAP_OPENGL_ES_2 macro define and clean up the code
2839         that it was (not) guarding.
2840
2841         * platform/graphics/texmap/BitmapTexture.h:
2842         * platform/graphics/texmap/BitmapTextureGL.cpp: Remove the TEXMAP_OPENGL_ES_2
2843         guard. Keep the GL_UNSIGNED_INT_8_8_8_8_REV define for OS(DARWIN), but use
2844         the GraphicsContext3D constants for other values.
2845         (WebCore::BitmapTextureGL::updateContentsNoSwizzle):
2846         (WebCore::BitmapTextureGL::initializeStencil): Remove the TEXMAP_OPENGL_ES_2
2847         guard and default to calling the renderbufferStorage() function with the
2848         GraphicsContext3D::STENCIL_INDEX8 argument.
2849         * platform/graphics/texmap/BitmapTexturePool.h:
2850         * platform/graphics/texmap/TextureMapper.h:
2851         * platform/graphics/texmap/TextureMapperGL.cpp: Remove both the TEXMAP_OPENGL_ES_2
2852         guard and the code it guarded. Because we were defining TEXMAP_OPENGL_ES_2 and not
2853         USE_TEXMAP_OPENGL_ES_2, the guarded defines were always enforced, but they're never
2854         actually used in this file anyway.
2855
2856 2015-12-09  Brady Eidson  <beidson@apple.com>
2857
2858         Modern IDB: storage/indexeddb/objectstore-basics.html fails.
2859         https://bugs.webkit.org/show_bug.cgi?id=152101
2860
2861         Reviewed by Alex Christensen.
2862
2863         No new tests (Multiple tests updated to the new error messaging cover it).
2864
2865         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2866         (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add plenty of detailed error messaging.
2867
2868 2015-12-09  Zalan Bujtas  <zalan@apple.com>
2869
2870         TextPainter: Make before and after selection painting more explicit.
2871         https://bugs.webkit.org/show_bug.cgi?id=152104
2872
2873         Reviewed by Myles C. Maxfield.
2874
2875         Instead of swapping start end end positions and expecting TextPainter::drawTextOrEmphasisMarks()
2876         to recognize it, we call painting with 0 - startPosition and endPosition - length.
2877
2878         No change in functionality.
2879
2880         * rendering/TextPainter.cpp:
2881         (WebCore::TextPainter::drawTextOrEmphasisMarks):
2882         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2883         (WebCore::TextPainter::paintText):
2884         (WebCore::TextPainter::paintEmphasisMarksIfNeeded): Deleted.
2885         (WebCore::TextPainter::paintTextWithStyle): Deleted.
2886         * rendering/TextPainter.h:
2887
2888 2015-12-09  Daniel Bates  <dabates@apple.com>
2889
2890         [iOS] Suspend and resume device motion and device orientation updates when page is hidden and visible, respectively
2891         https://bugs.webkit.org/show_bug.cgi?id=151840
2892         <rdar://problem/23753931>
2893
2894         Reviewed by Simon Fraser.
2895
2896         * dom/Document.cpp:
2897         (WebCore::Document::suspendDeviceMotionAndOrientationUpdates): Added.
2898         (WebCore::Document::resumeDeviceMotionAndOrientationUpdates): Added.
2899         (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Moved logic to suspend device motion and
2900         orientation updates from here to Document::suspendDeviceMotionAndOrientationUpdates().
2901         (WebCore::Document::suspendActiveDOMObjects): Modified to call Document::suspendDeviceMotionAndOrientationUpdates().
2902         (WebCore::Document::resumeActiveDOMObjects): Modified to call Document::resumeDeviceMotionAndOrientationUpdates().
2903         * dom/Document.h:
2904         * page/Page.cpp:
2905         (WebCore::Page::setIsVisibleInternal): Suspend device motion and orientation updates when the page is hidden and
2906         resume updates when the page is visible.
2907         (WebCore::Page::suspendDeviceMotionAndOrientationUpdates): Added.
2908         (WebCore::Page::resumeDeviceMotionAndOrientationUpdates): Added.
2909         * page/Page.h:
2910
2911 2015-12-09  Daniel Bates  <dabates@apple.com>
2912
2913         Unify iOS Frame::setTimersPaused() logic and Frame::{suspend, resume}ActiveDOMObjectsAndAnimations()
2914         https://bugs.webkit.org/show_bug.cgi?id=152006
2915
2916         Reviewed by Simon Fraser.
2917
2918         Currently we have almost identical logic to suspend and resume a web page for iOS and non-iOS ports.
2919         We should unify this logic instead of duplicating it.
2920
2921         * dom/ActiveDOMObject.h: Remove iOS-specific enumeration DocumentWillBePaused and standardize on
2922         enumerator PageWillBeSuspended.
2923         * dom/Document.cpp:
2924         (WebCore::Document::didBecomeCurrentDocumentInFrame): Unify iOS and non-iOS-specific code.
2925         (WebCore::Document::suspendScheduledTasks): Ignore subsequent calls to this function so long as the reason for
2926         the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent call may occur as part of
2927         handling a scroll or zoom gesture.
2928         * dom/ScriptExecutionContext.cpp:
2929         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ignore subsequent calls to this function
2930         so long as the reason for the first invocation was ActiveDOMObject::PageWillBeSuspended. Such a subsequent
2931         call may occur as part of the process of a page being added to the page cache.
2932         * html/HTMLMediaElement.cpp:
2933         (WebCore::HTMLMediaElement::suspend): Remove case for ActiveDOMObject::DocumentWillBePaused as this
2934         enumerator is being removed.
2935         * page/DOMTimer.cpp:
2936         (WebCore::DOMTimer::install): Write logic that used Frame::timersPaused() terms of
2937         ScriptExecutionContext::activeDOMObjectsAreSuspended() as we are removing Frame::timersPaused().
2938         (WebCore::DOMTimer::fired): Remove iOS-specific assertion with respect to Frame::timersPaused().
2939         This function already asserts the equivalent condition that ScriptExecutionContext::activeDOMObjectsAreSuspended()
2940         evaluates to false. Clean up iOS-specific code that depends on the ScriptExecutionContext being a
2941         Document object by taking advantage of the fact that this assumption is true when shouldBeginObservingChanges
2942         evaluates to true.
2943         * page/Frame.cpp:
2944         (WebCore::Frame::Frame): Remove instance variable m_timersPausedCount and unify the iOS and non-iOS logic.
2945         (WebCore::Frame::suspendActiveDOMObjectsAndAnimations): Standardize on the iOS logic for suspending
2946         DOM objects and animations because it is more comprehensive on what it suspends and works with the deferred
2947         loading machinery (Page::setDefersLoading() - see remarks in Frame::resumeActiveDOMObjectsAndAnimations() for
2948         more details). Specifically, make use of Frame::clearTimers() to suspend non-scripted animations (i.e. non-requestAnimationFrame()
2949         animations), auto-scroll timer, and pending relayouts. And use Document::suspendScheduledTasks() to suspend
2950         all other tasks, including WebSQL database callbacks, active DOM objects, scripted animations and execution of
2951         <script async>/<script defer> JavaScript scripts.
2952         (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): Standardize on the iOS logic for resuming
2953         DOM objects and animations for symmetry and because it works with the deferred loading machinery. We call
2954         Document::resumeScheduledTasks() (which calls Document::resumeActiveDOMObjects()) instead of calling
2955         Document::resumeActiveDOMObjects() directly because the former will ultimately process the queue of pending
2956         tasks (Document::m_pendingTasks).
2957         * page/Frame.h: Remove instance variable m_timersPausedCount.
2958         (WebCore::Frame::timersPaused): Deleted.
2959         * page/ios/FrameIOS.mm:
2960         (WebCore::Frame::setTimersPaused): Write this function in terms of Page::{suspend, resume}ActiveDOMObjectsAndAnimations().
2961         We need to keep this function for Legacy WebKit on iOS.
2962         (WebCore::Frame::setTimersPausedInternal): Deleted.
2963         * rendering/RenderElement.cpp:
2964         (WebCore::shouldRepaintForImageAnimation): Remove iOS-specific code to early return when Frame::timersPaused()
2965         evaluates to true. This function already has the equivalent code to early return when Document::activeDOMObjectsAreSuspended()
2966         evaluates to true.
2967
2968 2015-12-09  Brady Eidson  <beidson@apple.com>
2969
2970         Modern IDB: storage/indexeddb/metadata.html fails
2971         https://bugs.webkit.org/show_bug.cgi?id=152099
2972
2973         Reviewed by Alex Christensen.
2974
2975         Test: storage/indexeddb/modern/abort-objectstore-info.html
2976               And at least one existing failure now passes.
2977
2978         We did not properly reset object store info when version change transactions aborted.
2979
2980         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2981         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
2982         (WebCore::IDBClient::IDBObjectStore::rollbackInfoForVersionChangeAbort):
2983         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2984         
2985         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2986         (WebCore::IDBClient::IDBTransaction::abort):
2987
2988 2015-12-09  Simon Fraser  <simon.fraser@apple.com>
2989
2990         Adjust layer backing store format
2991         https://bugs.webkit.org/show_bug.cgi?id=152097
2992         rdar://problem/23305376
2993
2994         Reviewed by Tim Horton.
2995         
2996         Call setBackingStoreFormat() on UIWebView tile grid layers, and on compositing
2997         layers which can allocate backing store.
2998
2999         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3000         (WebCore::setBackingStoreFormat):
3001         (PlatformCALayerCocoa::commonInit):
3002         * platform/ios/LegacyTileGridTile.mm:
3003         (WebCore::setBackingStoreFormat):
3004         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
3005
3006 2015-12-09  Brady Eidson  <beidson@apple.com>
3007
3008         Modern IDB: storage/indexeddb/intversion-close-between-events.html fails.
3009         https://bugs.webkit.org/show_bug.cgi?id=152096
3010
3011         Reviewed by Alex Christensen.
3012
3013         No new tests (At least one failing test now passes).
3014
3015         * bindings/js/JSIDBDatabaseCustom.cpp:
3016         (WebCore::JSIDBDatabase::transaction): In addition to JSArrays, treat DOMStringLists as a valid string sequence.
3017     
3018 2015-12-09  Andreas Kling  <akling@apple.com>
3019
3020         [iOS] ResourceUsageOverlay should work on iOS.
3021         <https://webkit.org/b/152021>
3022
3023         Reviewed by Antti Koivisto.
3024
3025         Make ResourceUsageOverlay work on iOS and on Mac desktops with UI-side compositing.
3026
3027         * page/ResourceUsageOverlay.cpp:
3028         (WebCore::ResourceUsageOverlay::initialize): Move the overlay to the top of the view on iOS for now.
3029         * page/ResourceUsageOverlay.h:
3030         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3031         (WebCore::createColor): Make a custom CGColor factory since we can't use CGColorCreateGenericRGB on iOS.
3032         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
3033         (WebCore::ResourceUsageOverlay::platformInitialize): Put the overlay CALayer into a container layer and
3034         hook it up with GraphicsLayer::setContentsToPlatformLayer so it works with all compositing modes.
3035         (WebCore::showText): Move CGContextSaveGState call to the top of the function to preserve everything.
3036         (WebCore::drawGraphLabel):
3037         (WebCore::drawCpuHistory):
3038         (WebCore::drawGCHistory):
3039         (WebCore::ResourceUsageOverlay::platformDraw): Flip the CGContext if needed.
3040         (WebCore::runSamplerThread): Update the layer rects on each thread iteration. This shouldn't be
3041         necessary but it papers over an issue where the containing layer would shrink down to 0x0 and
3042         disappear. Added a FIXME for this.
3043         * platform/spi/cocoa/MachVMSPI.h: Add purgeable VM SPI.
3044
3045 2015-12-09  Brady Eidson  <beidson@apple.com>
3046
3047         Modern IDB: storage/indexeddb/database-closepending-flag.html fails.
3048         https://bugs.webkit.org/show_bug.cgi?id=152095
3049
3050         Reviewed by Alex Christensen.
3051
3052         No new tests (At least one failing test now passes).
3053         
3054         The server-side checks the closepending flag before dispatching the event to the client, 
3055         but due to the inherent asynchronous race between server and client, the client needs to 
3056         check its closePending flag as well.
3057
3058         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
3059         (WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent): Don't fire if m_closePending is set.
3060
3061 2015-12-09  David Hyatt  <hyatt@apple.com>
3062
3063         Picture element needs to respond to dynamic viewport changes.
3064         https://bugs.webkit.org/show_bug.cgi?id=152013
3065         <rdar://problem/23766375>
3066
3067         Reviewed by Dean Jackson.
3068
3069         Added new tests in fast/picture.
3070
3071         * css/MediaQueryEvaluator.cpp:
3072         (WebCore::MediaQueryEvaluator::evalCheckingViewportDependentResults):
3073         Add new evaluation method that adds viewport dependent results to a vector. A follow-up patch
3074         will refactor the style resolver code to use this function instead of the special style resolver one, in order to
3075         get rid of the code duplication. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152089.
3076
3077         * css/MediaQueryEvaluator.h:
3078         (WebCore::MediaQueryResult::MediaQueryResult):
3079         * css/StyleResolver.h:
3080         (WebCore::MediaQueryResult::MediaQueryResult): Deleted.
3081         Move MediaQueryResult into a header since it is used in multiple places now and not just by the style
3082         resolver.
3083
3084         * dom/Document.cpp:
3085         (WebCore::Document::evaluateMediaQueryList):
3086         (WebCore::Document::checkViewportDependentPictures):
3087         (WebCore::Document::optimizedStyleSheetUpdateTimerFired):
3088         (WebCore::Document::applyContentDispositionAttachmentSandbox):
3089         (WebCore::Document::addViewportDependentPicture):
3090         (WebCore::Document::removeViewportDependentPicture):
3091         * dom/Document.h:
3092         The document now maintains a HashSet of viewport-dependent pictures, and it checks them whenever the
3093         viewport changes. If their media queries stay the same, then nothing happens. If they change, then
3094         the <picture> will go back and re-check all its <source> elements to see what the new best candidate is.
3095
3096         * html/HTMLImageElement.cpp:
3097         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3098         Revised to check for viewport dependencies and to cache viewport-dependent results on the <picture> elements.
3099         When a <picture> is found to be viewport-dependent (or not) it is also added to or removed from the document's
3100         set of tracked pictures.
3101
3102         * html/HTMLPictureElement.cpp:
3103         (WebCore::HTMLPictureElement::HTMLPictureElement):
3104         (WebCore::HTMLPictureElement::~HTMLPictureElement):
3105         (WebCore::HTMLPictureElement::didMoveToNewDocument):
3106         (WebCore::HTMLPictureElement::create):
3107         (WebCore::HTMLPictureElement::sourcesChanged):
3108         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
3109         * html/HTMLPictureElement.h:
3110         New caching of results and updating of the document HashSet when the picture gets destroyed or moves to
3111         a different document.
3112
3113         * html/HTMLSourceElement.cpp:
3114         (WebCore::HTMLSourceElement::parseAttribute):
3115         * html/HTMLSourceElement.h:
3116         Cache the media attribute in a parsed form. A follow-up patch will improve the <video>/<audio>
3117         code to make use of this parsed result. Tracked by https://bugs.webkit.org/show_bug.cgi?id=152090.
3118
3119 2015-12-09  Zalan Bujtas  <zalan@apple.com>
3120
3121         TextPainter: Rename start and end position to selectionStart and selectionEnd.
3122         https://bugs.webkit.org/show_bug.cgi?id=152088
3123
3124         Reviewed by Myles C. Maxfield.
3125
3126         They actually mean selection start/end.
3127
3128         No change in functionality.
3129
3130         * rendering/InlineTextBox.cpp:
3131         (WebCore::InlineTextBox::paint):
3132         * rendering/TextPainter.cpp:
3133         (WebCore::TextPainter::TextPainter):
3134         (WebCore::TextPainter::paintText):
3135         * rendering/TextPainter.h:
3136
3137 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
3138
3139         AX: [GTK] Anonymous render block flow elements should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL
3140         https://bugs.webkit.org/show_bug.cgi?id=152070
3141
3142         Reviewed by Mario Sanchez Prada.
3143
3144         Map the element to WebCore AccessibilityRole DivRole for GTK. This is being
3145         done in the shared layer rather than in the platform layer because we want all
3146         subsequent logic to treat anonymous render block flow elements as divs.
3147
3148         No new tests. We already have sufficient test coverage. The expectations
3149         been updated accordingly.
3150
3151         * accessibility/AccessibilityRenderObject.cpp:
3152         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3153
3154 2015-12-09  Keith Rollin  <krollin@apple.com>
3155
3156         form.elements should reflect the element ordering after the HTML tree builder algorithm
3157         https://bugs.webkit.org/show_bug.cgi?id=148870
3158         rdar://problem/22589879
3159
3160         Reviewed by Ryosuke Niwa.
3161
3162         form.elements should return form-associated elements in tree order.
3163         However, when presented with an HTML fragment like the following,
3164         forms.elements is not built in tree order. Instead, the elements
3165         appear in forms.element in the same order they appear in the HTML --
3166         that is in the same order as they are parsed.
3167
3168         <form id=form>
3169             <table>
3170                 <tr>
3171                     <td><input type="radio" name="radio1" id="r1" value=1></td>
3172                     <td><input type="radio" name="radio2" id="r2" value=2></td>
3173                     <input type="radio" name="radio0" id="r0" value=0>
3174                 </tr>
3175             </table>
3176         </form>
3177
3178         The reason why elements appear in forms.elements in parse order is
3179         because they register themselves with the designated form when they
3180         are created. At this time, they are not in the DOM tree, so the form
3181         can only assume that the element will be appended to the DOM tree,
3182         with the result that it records the elements in the HTML fragment
3183         above as [r1, r2, r0].
3184
3185         However, it's not always the case that the newly-created element will
3186         be appended to the current tree. In the HTML fragment above, the r0
3187         input element is hoised out of the table element. It ends up being the
3188         preceding sibling of the table element, with the result that the
3189         actual tree-order of the input elements is [r0, r1, r2].
3190
3191         Because the problem is due to registering form-associated elements
3192         with the form *before* the elements are added to the DOM tree, the
3193         solution is to defer that registration until afterwards. With the new
3194         element in the tree, the form can now use its current location in the
3195         tree to correctly place the element in form.elements.
3196
3197         Existing tests now pass:
3198         - imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-elements-nameditem-02-html
3199
3200         * html/FormAssociatedElement.cpp:
3201         (WebCore::FormAssociatedElement::FormAssociatedElement):
3202         (WebCore::FormAssociatedElement::insertedInto):
3203         (WebCore::FormAssociatedElement::removedFrom):
3204         (WebCore::FormAssociatedElement::formRemovedFromTree):
3205         (WebCore::FormAssociatedElement::formWillBeDestroyed):
3206         * html/FormAssociatedElement.h:
3207         * html/HTMLFormControlElement.cpp:
3208         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
3209         * html/HTMLImageElement.cpp:
3210         (WebCore::HTMLImageElement::HTMLImageElement):
3211         (WebCore::HTMLImageElement::insertedInto):
3212         (WebCore::HTMLImageElement::removedFrom):
3213         * html/HTMLImageElement.h:
3214         * html/HTMLObjectElement.cpp:
3215         (WebCore::HTMLObjectElement::HTMLObjectElement):
3216
3217 2015-12-09  Gwang Yoon Hwang  <yoon@igalia.com>
3218
3219         [ThreadedCompositor] Support HTML5 Video
3220         https://bugs.webkit.org/show_bug.cgi?id=143301
3221
3222         Reviewed by Žan Doberšek.
3223
3224         This patch implements HTML5 Video supports in Threaded Compositor.
3225
3226         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3227         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
3228         Added to support GStreamer GL by ensuring unmapping of the swapped
3229         GstVideoFrame performed at GStreamer GL's gl thread.
3230         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
3231         Modified to upload decoded frame to the given texture instead of
3232         creating a texture itself because we should use a texture from the
3233         proxy when we are using the threaded compositor.
3234         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3235         Implements two ways to send a texture from GStreamer to the compositor.
3236         1. If we are not using GStreamer GL, we are going to acquire a free texture
3237         from a TextureMapperPlatformLayerProxy and upload the decoded frame to the
3238         texture. This should be done at the compositing thread because we
3239         don't have a Gst's GL thread.
3240         2. If we are using GStreamer GL, we map a texture for the given frame
3241         and passes it to the compositing thread. The mapped frame will be
3242         freed if it is swapped out or the layer is removed.
3243
3244         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
3245         Modified to aquire a new texture itself.
3246
3247         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3248         Adds a way to pass a function to the compositing thread to allocate /
3249         upload textures at the compositing thread.
3250
3251
3252 2015-12-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3253
3254         [Streams API] pipeThrough test failing
3255         https://bugs.webkit.org/show_bug.cgi?id=152061
3256
3257         Reviewed by Youenn Fablet.
3258
3259         Test: imported/w3c/web-platform-tests/streams-api/readable-streams/pipe-through.html
3260
3261         * Modules/streams/ReadableStream.js:
3262         (pipeThrough): Mimic destructuring for the streams parameter.
3263
3264 2015-12-09  Frederic Wang  <fred.wang@free.fr>
3265
3266         Bad position of large operators inside an munderover element
3267         https://bugs.webkit.org/show_bug.cgi?id=151916
3268
3269         Reviewed by Alejandro G. Castro.
3270
3271         Test: mathml/opentype/large-operators-munderover.html
3272
3273         * rendering/mathml/RenderMathMLOperator.h:
3274         (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator.
3275         * rendering/mathml/RenderMathMLUnderOver.cpp:
3276         (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators.
3277
3278 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3279
3280         [TexMap] TextureMapperTiledBackingStore should notify the ImageObserver of the data access
3281         https://bugs.webkit.org/show_bug.cgi?id=152053
3282
3283         Reviewed by Martin Robinson.
3284
3285         TextureMapperTiledBackingStore should call ImageObserver::didDraw() on the Image's
3286         observer after updating the tile with the Image's data. This way the CachedImage
3287         (i.e. the observer) can mark the data access with the current timestamp, avoiding
3288         removing the decoded data in the very near future during a cache purge.
3289
3290         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
3291         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
3292
3293 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3294
3295         Make MainThreadSharedTimerGtk implementation GLib-specific
3296         https://bugs.webkit.org/show_bug.cgi?id=152044
3297
3298         Reviewed by Carlos Garcia Campos.
3299
3300         MainThreadSharedTimerGtk has implementation that only directly depends
3301         on GLib, and not GTK+. Because of that it can be moved under
3302         Source/WebCore/platform/glib and slightly renamed.
3303
3304         * PlatformGTK.cmake:
3305         * platform/glib/MainThreadSharedTimerGLib.cpp: Renamed from Source/WebCore/platform/gtk/MainThreadSharedTimerGtk.cpp.
3306         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
3307         (WebCore::MainThreadSharedTimer::setFireInterval):
3308         (WebCore::MainThreadSharedTimer::stop):
3309         (WebCore::MainThreadSharedTimer::invalidate):
3310         * platform/gtk/MainThreadSharedTimerGtk.cpp:
3311         (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): Deleted.
3312         (WebCore::MainThreadSharedTimer::setFireInterval): Deleted.
3313         (WebCore::MainThreadSharedTimer::stop): Deleted.
3314         (WebCore::MainThreadSharedTimer::invalidate): Deleted.
3315
3316 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3317
3318         [TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4
3319         https://bugs.webkit.org/show_bug.cgi?id=152042
3320
3321         Reviewed by Martin Robinson.
3322
3323         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
3324         (WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out
3325         the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4
3326         and fill that via the TransformationMatrix::toColumnMajorFloatArray() method
3327         called on the passed-in TransformationMatrix.
3328
3329 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3330
3331         [Soup] Attach the SocketStreamHandleSoup write-ready source to the thread-default context
3332         https://bugs.webkit.org/show_bug.cgi?id=152041
3333
3334         Reviewed by Carlos Garcia Campos.
3335
3336         * platform/network/soup/SocketStreamHandleSoup.cpp:
3337         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Attach the
3338         write-ready source to the thread-default context, instead of implicitly
3339         relying on the default context for dispatching.
3340
3341 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3342
3343         [Soup] SocketStreamHandle should call g_source_destroy() on the write-ready source
3344         https://bugs.webkit.org/show_bug.cgi?id=152040
3345
3346         Reviewed by Carlos Garcia Campos.
3347
3348         * platform/network/soup/SocketStreamHandleSoup.cpp:
3349         (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Instead of
3350         calling the g_source_get_id()-g_source_remove() pair, destroy the source via
3351         the g_source_destroy() call. Also use nullptr to clear out the pointer
3352         variable.
3353
3354 2015-12-09  Zan Dobersek  <zdobersek@igalia.com>
3355
3356         Make AudioBusGtk implementation GLib-specific
3357         https://bugs.webkit.org/show_bug.cgi?id=152049
3358
3359         Reviewed by Philippe Normand.
3360
3361         AudioBusGtk only depends on GLib, so it should be moved to
3362         Source/WebCore/platform/audio/glib and the implementation file
3363         renamed to AudioBusGLib.cpp.
3364
3365         The hard-coded webkitgtk path component can be addressed later.
3366
3367         * PlatformGTK.cmake: Update the build target.
3368         * platform/audio/glib/AudioBusGLib.cpp: Renamed from Source/WebCore/platform/audio/gtk/AudioBusGtk.cpp.
3369         (WebCore::AudioBus::loadPlatformResource):
3370         * platform/audio/gtk/AudioBusGtk.cpp:
3371         (WebCore::AudioBus::loadPlatformResource): Deleted.
3372
3373 2015-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
3374
3375         AX: [EFL] Consider deferring to WebCore Accessibility for table exposure
3376         https://bugs.webkit.org/show_bug.cgi?id=144898
3377
3378         Reviewed by Darin Adler.
3379
3380         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
3381         for WebKitEfl.
3382
3383         No new tests. Several existing tests already cover table exposure. They have
3384         been updated accordingly.
3385
3386         * accessibility/AccessibilityTable.cpp:
3387         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
3388
3389 2015-12-08  Simon Fraser  <simon.fraser@apple.com>
3390
3391         Convert resetAnimValToBaseVal take a reference to a SVGAnimatedType
3392         https://bugs.webkit.org/show_bug.cgi?id=152036
3393
3394         Reviewed by Zalan Bujtas.
3395         
3396         Change resetAnimValToBaseVal() to take a reference at the last argument.
3397
3398         * svg/SVGAnimateElementBase.cpp:
3399         (WebCore::SVGAnimateElementBase::resetAnimatedType):
3400         * svg/SVGAnimatedAngle.cpp:
3401         (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
3402         * svg/SVGAnimatedAngle.h:
3403         * svg/SVGAnimatedBoolean.cpp:
3404         (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
3405         * svg/SVGAnimatedBoolean.h:
3406         * svg/SVGAnimatedColor.h:
3407         * svg/SVGAnimatedEnumeration.cpp:
3408         (WebCore::SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal):
3409         * svg/SVGAnimatedEnumeration.h:
3410         * svg/SVGAnimatedInteger.cpp:
3411         (WebCore::SVGAnimatedIntegerAnimator::resetAnimValToBaseVal):
3412         * svg/SVGAnimatedInteger.h:
3413         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
3414         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal):
3415         * svg/SVGAnimatedIntegerOptionalInteger.h:
3416         * svg/SVGAnimatedLength.cpp:
3417         (WebCore::SVGAnimatedLengthAnimator::resetAnimValToBaseVal):
3418         * svg/SVGAnimatedLength.h:
3419         * svg/SVGAnimatedLengthList.cpp:
3420         (WebCore::SVGAnimatedLengthListAnimator::resetAnimValToBaseVal):
3421         * svg/SVGAnimatedLengthList.h:
3422         * svg/SVGAnimatedNumber.cpp:
3423         (WebCore::SVGAnimatedNumberAnimator::resetAnimValToBaseVal):
3424         * svg/SVGAnimatedNumber.h:
3425         * svg/SVGAnimatedNumberList.cpp:
3426         (WebCore::SVGAnimatedNumberListAnimator::resetAnimValToBaseVal):
3427         * svg/SVGAnimatedNumberList.h: