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