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