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