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