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