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