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