<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[194410] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/194410">194410</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2015-12-23 19:43:23 -0800 (Wed, 23 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use "constrainedBetween" in more places
https://bugs.webkit.org/show_bug.cgi?id=152543
Reviewed by Zalan Bujtas.
Replace code that contrains points via shrunkTo/expandedTo() with calls
to constrainedBetween(), and implement constrainedBetween() on IntPoint,
FloatPoint and LayoutPoint.
Convert some functions that return points to more modern syntax.
Source/WebCore:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
* platform/ScrollView.cpp:
(WebCore::ScrollView::adjustScrollPositionWithinRange):
* platform/graphics/FloatPoint.cpp:
(WebCore::FloatPoint::constrainedBetween):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::shrunkTo):
(WebCore::FloatPoint::expandedTo):
(WebCore::FloatPoint::transposedPoint):
* platform/graphics/IntPoint.cpp:
* platform/graphics/LayoutPoint.cpp:
(WebCore::LayoutPoint::constrainedBetween):
* platform/graphics/LayoutPoint.h:
(WebCore::LayoutPoint::expandedTo):
(WebCore::LayoutPoint::shrunkTo):
(WebCore::LayoutPoint::transposedPoint):
(WebCore::LayoutPoint::fraction):
(WebCore::LayoutPoint::operator FloatPoint):
Source/WebKit2:
* UIProcess/API/Cocoa/WKWebView.mm:
(constrainContentOffset):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp">trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatPointcpp">trunk/Source/WebCore/platform/graphics/FloatPoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatPointh">trunk/Source/WebCore/platform/graphics/FloatPoint.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIntPointcpp">trunk/Source/WebCore/platform/graphics/IntPoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsLayoutPointcpp">trunk/Source/WebCore/platform/graphics/LayoutPoint.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsLayoutPointh">trunk/Source/WebCore/platform/graphics/LayoutPoint.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/ChangeLog        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -1,5 +1,40 @@
</span><span class="cx"> 2015-12-23 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><ins>+ Use "constrainedBetween" in more places
+ https://bugs.webkit.org/show_bug.cgi?id=152543
+
+ Reviewed by Zalan Bujtas.
+
+ Replace code that contrains points via shrunkTo/expandedTo() with calls
+ to constrainedBetween(), and implement constrainedBetween() on IntPoint,
+ FloatPoint and LayoutPoint.
+
+ Convert some functions that return points to more modern syntax.
+
+ * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
+ (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition):
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::adjustScrollPositionWithinRange):
+ * platform/graphics/FloatPoint.cpp:
+ (WebCore::FloatPoint::constrainedBetween):
+ * platform/graphics/FloatPoint.h:
+ (WebCore::FloatPoint::shrunkTo):
+ (WebCore::FloatPoint::expandedTo):
+ (WebCore::FloatPoint::transposedPoint):
+ * platform/graphics/IntPoint.cpp:
+ * platform/graphics/LayoutPoint.cpp:
+ (WebCore::LayoutPoint::constrainedBetween):
+ * platform/graphics/LayoutPoint.h:
+ (WebCore::LayoutPoint::expandedTo):
+ (WebCore::LayoutPoint::shrunkTo):
+ (WebCore::LayoutPoint::transposedPoint):
+ (WebCore::LayoutPoint::fraction):
+ (WebCore::LayoutPoint::operator FloatPoint):
+
+2015-12-23 Simon Fraser <simon.fraser@apple.com>
+
</ins><span class="cx"> REGRESSION (r187593): Scroll position jumps when selecting text in an iframe
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=152541
</span><span class="cx"> rdar://problem/23886181
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeFrameScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -82,10 +82,7 @@
</span><span class="cx">
</span><span class="cx"> void ScrollingTreeFrameScrollingNode::setScrollPosition(const FloatPoint& scrollPosition)
</span><span class="cx"> {
</span><del>- FloatPoint newScrollPosition = scrollPosition;
- newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
- newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
-
</del><ins>+ FloatPoint newScrollPosition = scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
</ins><span class="cx"> setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingScrollingTreeScrollingNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -103,10 +103,7 @@
</span><span class="cx">
</span><span class="cx"> void ScrollingTreeScrollingNode::setScrollPosition(const FloatPoint& scrollPosition)
</span><span class="cx"> {
</span><del>- FloatPoint newScrollPosition = scrollPosition;
- newScrollPosition = newScrollPosition.shrunkTo(maximumScrollPosition());
- newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
-
</del><ins>+ FloatPoint newScrollPosition = scrollPosition.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
</ins><span class="cx"> setScrollPositionWithoutContentEdgeConstraints(newScrollPosition);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -403,9 +403,7 @@
</span><span class="cx"> if (!constrainsScrollingToContentEdge())
</span><span class="cx"> return scrollPoint;
</span><span class="cx">
</span><del>- IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition());
- newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
- return newScrollPosition;
</del><ins>+ return scrollPoint.constrainedBetween(minimumScrollPosition(), maximumScrollPosition());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IntSize ScrollView::documentScrollOffsetRelativeToViewOrigin() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatPointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatPoint.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -41,6 +41,14 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+FloatPoint FloatPoint::constrainedBetween(const FloatPoint& min, const FloatPoint& max) const
+{
+ return {
+ std::max(min.x(), std::min(max.x(), m_x)),
+ std::max(min.y(), std::min(max.y(), m_y))
+ };
+}
+
</ins><span class="cx"> void FloatPoint::normalize()
</span><span class="cx"> {
</span><span class="cx"> float tempLength = length();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatPoint.h        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -121,19 +121,21 @@
</span><span class="cx"> return m_x * m_x + m_y * m_y;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT FloatPoint constrainedBetween(const FloatPoint& min, const FloatPoint& max) const;
+
</ins><span class="cx"> FloatPoint shrunkTo(const FloatPoint& other) const
</span><span class="cx"> {
</span><del>- return FloatPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y));
</del><ins>+ return { std::min(m_x, other.m_x), std::min(m_y, other.m_y) };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FloatPoint expandedTo(const FloatPoint& other) const
</span><span class="cx"> {
</span><del>- return FloatPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y));
</del><ins>+ return { std::max(m_x, other.m_x), std::max(m_y, other.m_y) };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FloatPoint transposedPoint() const
</span><span class="cx"> {
</span><del>- return FloatPoint(m_y, m_x);
</del><ins>+ return { m_y, m_x };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(CG)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIntPointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/IntPoint.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/IntPoint.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> TextStream& operator<<(TextStream& ts, const IntPoint& p)
</span><span class="cx"> {
</span><span class="cx"> return ts << "(" << p.x() << "," << p.y() << ")";
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsLayoutPointcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/LayoutPoint.cpp (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/LayoutPoint.cpp        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/graphics/LayoutPoint.cpp        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -30,6 +30,14 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+LayoutPoint LayoutPoint::constrainedBetween(const LayoutPoint& min, const LayoutPoint& max) const
+{
+ return {
+ std::max(min.x(), std::min(max.x(), m_x)),
+ std::max(min.y(), std::min(max.y(), m_y))
+ };
+}
+
</ins><span class="cx"> TextStream& operator<<(TextStream& ts, const LayoutPoint& p)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: These should be printed as floats. Keeping them ints for consistency with pervious test expectations.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsLayoutPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/LayoutPoint.h (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/LayoutPoint.h        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebCore/platform/graphics/LayoutPoint.h        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -60,15 +60,17 @@
</span><span class="cx"> m_x *= sx;
</span><span class="cx"> m_y *= sy;
</span><span class="cx"> }
</span><del>-
</del><ins>+
+ LayoutPoint constrainedBetween(const LayoutPoint& min, const LayoutPoint& max) const;
+
</ins><span class="cx"> LayoutPoint expandedTo(const LayoutPoint& other) const
</span><span class="cx"> {
</span><del>- return LayoutPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y));
</del><ins>+ return { std::max(m_x, other.m_x), std::max(m_y, other.m_y) };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutPoint shrunkTo(const LayoutPoint& other) const
</span><span class="cx"> {
</span><del>- return LayoutPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y));
</del><ins>+ return { std::min(m_x, other.m_x), std::min(m_y, other.m_y) };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void clampNegativeToZero()
</span><span class="lines">@@ -78,15 +80,15 @@
</span><span class="cx">
</span><span class="cx"> LayoutPoint transposedPoint() const
</span><span class="cx"> {
</span><del>- return LayoutPoint(m_y, m_x);
</del><ins>+ return { m_y, m_x };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> LayoutPoint fraction() const
</span><span class="cx"> {
</span><del>- return LayoutPoint(m_x.fraction(), m_y.fraction());
</del><ins>+ return { m_x.fraction(), m_y.fraction() };
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- operator FloatPoint() const { return FloatPoint(m_x, m_y); }
</del><ins>+ operator FloatPoint() const { return { m_x, m_y }; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> LayoutUnit m_x, m_y;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebKit2/ChangeLog        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-12-23 Simon Fraser <simon.fraser@apple.com>
+
+ Use "constrainedBetween" in more places
+ https://bugs.webkit.org/show_bug.cgi?id=152543
+
+ Reviewed by Zalan Bujtas.
+
+ Replace code that contrains points via shrunkTo/expandedTo() with calls
+ to constrainedBetween(), and implement constrainedBetween() on IntPoint,
+ FloatPoint and LayoutPoint.
+
+ Convert some functions that return points to more modern syntax.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (constrainContentOffset):
+
</ins><span class="cx"> 2015-12-22 Hunseop Jeong <hs85.jeong@samsung.com>
</span><span class="cx">
</span><span class="cx"> [EFL] ewk_application_cache_manager test failed after r193812
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (194409 => 194410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-12-24 02:17:03 UTC (rev 194409)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-12-24 03:43:23 UTC (rev 194410)
</span><span class="lines">@@ -1259,9 +1259,7 @@
</span><span class="cx"> static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOffset, WebCore::FloatSize contentSize, WebCore::FloatSize unobscuredContentSize)
</span><span class="cx"> {
</span><span class="cx"> WebCore::FloatSize maximumContentOffset = contentSize - unobscuredContentSize;
</span><del>- contentOffset = contentOffset.shrunkTo(WebCore::FloatPoint(maximumContentOffset.width(), maximumContentOffset.height()));
- contentOffset = contentOffset.expandedTo(WebCore::FloatPoint());
- return contentOffset;
</del><ins>+ return contentOffset.constrainedBetween(WebCore::FloatPoint(), WebCore::FloatPoint(maximumContentOffset));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_scrollToContentOffset:(WebCore::FloatPoint)contentOffsetInPageCoordinates scrollOrigin:(WebCore::IntPoint)scrollOrigin
</span></span></pre>
</div>
</div>
</body>
</html>