- Revision
- 101045
- Author
- [email protected]
- Date
- 2011-11-23 00:21:18 -0800 (Wed, 23 Nov 2011)
Log Message
Change remaining scrollTop/Left/Width/Height methods back to int
https://bugs.webkit.org/show_bug.cgi?id=72771
Reviewed by Eric Seidel.
Change remaining scrollTop/Left/Width/Height, setScrollLeft/Top and
verticalScrollbarWidth, horizontalScrollbarHeight methods back to int as
scrolling will remain int based to line up with device pixels.
No new tests.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::scrollWidth):
(WebCore::RenderBox::scrollHeight):
(WebCore::RenderBox::scrollLeft):
(WebCore::RenderBox::scrollTop):
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
(WebCore::RenderBox::verticalScrollbarWidth):
(WebCore::RenderBox::horizontalScrollbarHeight):
* rendering/RenderBox.h:
(WebCore::RenderBox::scrollbarLogicalHeight):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::verticalScrollbarWidth):
(WebCore::RenderListBox::scrollHeight):
(WebCore::RenderListBox::scrollLeft):
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::scrollTop):
(WebCore::RenderListBox::setScrollTop):
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::scrollWidth):
(WebCore::RenderTextControlSingleLine::scrollHeight):
(WebCore::RenderTextControlSingleLine::scrollLeft):
(WebCore::RenderTextControlSingleLine::scrollTop):
(WebCore::RenderTextControlSingleLine::setScrollLeft):
(WebCore::RenderTextControlSingleLine::setScrollTop):
* rendering/RenderTextControlSingleLine.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (101044 => 101045)
--- trunk/Source/WebCore/ChangeLog 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/ChangeLog 2011-11-23 08:21:18 UTC (rev 101045)
@@ -1,3 +1,44 @@
+2011-11-23 Emil A Eklund <[email protected]>
+
+ Change remaining scrollTop/Left/Width/Height methods back to int
+ https://bugs.webkit.org/show_bug.cgi?id=72771
+
+ Reviewed by Eric Seidel.
+
+ Change remaining scrollTop/Left/Width/Height, setScrollLeft/Top and
+ verticalScrollbarWidth, horizontalScrollbarHeight methods back to int as
+ scrolling will remain int based to line up with device pixels.
+
+ No new tests.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::scrollWidth):
+ (WebCore::RenderBox::scrollHeight):
+ (WebCore::RenderBox::scrollLeft):
+ (WebCore::RenderBox::scrollTop):
+ (WebCore::RenderBox::setScrollLeft):
+ (WebCore::RenderBox::setScrollTop):
+ (WebCore::RenderBox::verticalScrollbarWidth):
+ (WebCore::RenderBox::horizontalScrollbarHeight):
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::scrollbarLogicalHeight):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::verticalScrollbarWidth):
+ (WebCore::RenderListBox::scrollHeight):
+ (WebCore::RenderListBox::scrollLeft):
+ (WebCore::RenderListBox::setScrollLeft):
+ (WebCore::RenderListBox::scrollTop):
+ (WebCore::RenderListBox::setScrollTop):
+ * rendering/RenderListBox.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::scrollWidth):
+ (WebCore::RenderTextControlSingleLine::scrollHeight):
+ (WebCore::RenderTextControlSingleLine::scrollLeft):
+ (WebCore::RenderTextControlSingleLine::scrollTop):
+ (WebCore::RenderTextControlSingleLine::setScrollLeft):
+ (WebCore::RenderTextControlSingleLine::setScrollTop):
+ * rendering/RenderTextControlSingleLine.h:
+
2011-11-22 Kenneth Russell <[email protected]>
[chromium] Support Core Animation plugins in compositor
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-11-23 08:21:18 UTC (rev 101045)
@@ -475,7 +475,7 @@
return height() - borderTop() - borderBottom() - horizontalScrollbarHeight();
}
-LayoutUnit RenderBox::scrollWidth() const
+int RenderBox::scrollWidth() const
{
if (hasOverflowClip())
return layer()->scrollWidth();
@@ -483,10 +483,10 @@
// FIXME: Need to work right with writing modes.
if (style()->isLeftToRightDirection())
return max(clientWidth(), maxXLayoutOverflow() - borderLeft());
- return clientWidth() - min<LayoutUnit>(0, minXLayoutOverflow() - borderLeft());
+ return clientWidth() - min(0, minXLayoutOverflow() - borderLeft());
}
-LayoutUnit RenderBox::scrollHeight() const
+int RenderBox::scrollHeight() const
{
if (hasOverflowClip())
return layer()->scrollHeight();
@@ -495,23 +495,23 @@
return max(clientHeight(), maxYLayoutOverflow() - borderTop());
}
-LayoutUnit RenderBox::scrollLeft() const
+int RenderBox::scrollLeft() const
{
return hasOverflowClip() ? layer()->scrollXOffset() : 0;
}
-LayoutUnit RenderBox::scrollTop() const
+int RenderBox::scrollTop() const
{
return hasOverflowClip() ? layer()->scrollYOffset() : 0;
}
-void RenderBox::setScrollLeft(LayoutUnit newLeft)
+void RenderBox::setScrollLeft(int newLeft)
{
if (hasOverflowClip())
layer()->scrollToXOffset(newLeft, RenderLayer::ScrollOffsetClamped);
}
-void RenderBox::setScrollTop(LayoutUnit newTop)
+void RenderBox::setScrollTop(int newTop)
{
if (hasOverflowClip())
layer()->scrollToYOffset(newTop, RenderLayer::ScrollOffsetClamped);
@@ -643,12 +643,12 @@
&& (style()->overflowX() == OSCROLL || style()->overflowX() == OAUTO);
}
-LayoutUnit RenderBox::verticalScrollbarWidth() const
+int RenderBox::verticalScrollbarWidth() const
{
return includeVerticalScrollbarSize() ? layer()->verticalScrollbarWidth() : 0;
}
-LayoutUnit RenderBox::horizontalScrollbarHeight() const
+int RenderBox::horizontalScrollbarHeight() const
{
return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0;
}
Modified: trunk/Source/WebCore/rendering/RenderBox.h (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-11-23 08:21:18 UTC (rev 101045)
@@ -199,12 +199,12 @@
// scrollLeft/Top return the current scroll position. These methods are virtual so that objects like
// textareas can scroll shadow content (but pretend that they are the objects that are
// scrolling).
- virtual LayoutUnit scrollLeft() const;
- virtual LayoutUnit scrollTop() const;
- virtual LayoutUnit scrollWidth() const;
- virtual LayoutUnit scrollHeight() const;
- virtual void setScrollLeft(LayoutUnit);
- virtual void setScrollTop(LayoutUnit);
+ virtual int scrollLeft() const;
+ virtual int scrollTop() const;
+ virtual int scrollWidth() const;
+ virtual int scrollHeight() const;
+ virtual void setScrollLeft(int);
+ virtual void setScrollTop(int);
virtual LayoutUnit marginTop() const { return m_marginTop; }
virtual LayoutUnit marginBottom() const { return m_marginBottom; }
@@ -340,9 +340,9 @@
LayoutUnit availableWidth() const { return style()->isHorizontalWritingMode() ? availableLogicalWidth() : availableLogicalHeight(); }
LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); }
- virtual LayoutUnit verticalScrollbarWidth() const;
- LayoutUnit horizontalScrollbarHeight() const;
- LayoutUnit scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
+ virtual int verticalScrollbarWidth() const;
+ int horizontalScrollbarHeight() const;
+ int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
bool canBeScrolledAndHasScrollableArea() const;
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-11-23 08:21:18 UTC (rev 101045)
@@ -634,7 +634,7 @@
return style()->fontMetrics().height() + rowSpacing;
}
-LayoutUnit RenderListBox::verticalScrollbarWidth() const
+int RenderListBox::verticalScrollbarWidth() const
{
return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : LayoutUnit(0);
}
@@ -647,26 +647,26 @@
return clientWidth();
}
-LayoutUnit RenderListBox::scrollHeight() const
+int RenderListBox::scrollHeight() const
{
return max(clientHeight(), listHeight());
}
-LayoutUnit RenderListBox::scrollLeft() const
+int RenderListBox::scrollLeft() const
{
return 0;
}
-void RenderListBox::setScrollLeft(LayoutUnit)
+void RenderListBox::setScrollLeft(int)
{
}
-LayoutUnit RenderListBox::scrollTop() const
+int RenderListBox::scrollTop() const
{
return m_indexOffset * itemHeight();
}
-void RenderListBox::setScrollTop(LayoutUnit newTop)
+void RenderListBox::setScrollTop(int newTop)
{
// Determine an index and scroll to it.
int index = newTop / itemHeight();
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2011-11-23 08:21:18 UTC (rev 101045)
@@ -88,13 +88,13 @@
virtual bool shouldPanScroll() const { return true; }
virtual void panScroll(const IntPoint&);
- virtual LayoutUnit verticalScrollbarWidth() const;
- virtual LayoutUnit scrollLeft() const;
- virtual LayoutUnit scrollTop() const;
- virtual LayoutUnit scrollWidth() const;
- virtual LayoutUnit scrollHeight() const;
- virtual void setScrollLeft(LayoutUnit);
- virtual void setScrollTop(LayoutUnit);
+ virtual int verticalScrollbarWidth() const;
+ virtual int scrollLeft() const;
+ virtual int scrollTop() const;
+ virtual int scrollWidth() const;
+ virtual int scrollHeight() const;
+ virtual void setScrollLeft(int);
+ virtual void setScrollTop(int);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-11-23 08:21:18 UTC (rev 101045)
@@ -707,41 +707,41 @@
layer->autoscroll();
}
-LayoutUnit RenderTextControlSingleLine::scrollWidth() const
+int RenderTextControlSingleLine::scrollWidth() const
{
if (innerTextElement())
return innerTextElement()->scrollWidth();
return RenderBlock::scrollWidth();
}
-LayoutUnit RenderTextControlSingleLine::scrollHeight() const
+int RenderTextControlSingleLine::scrollHeight() const
{
if (innerTextElement())
return innerTextElement()->scrollHeight();
return RenderBlock::scrollHeight();
}
-LayoutUnit RenderTextControlSingleLine::scrollLeft() const
+int RenderTextControlSingleLine::scrollLeft() const
{
if (innerTextElement())
return innerTextElement()->scrollLeft();
return RenderBlock::scrollLeft();
}
-LayoutUnit RenderTextControlSingleLine::scrollTop() const
+int RenderTextControlSingleLine::scrollTop() const
{
if (innerTextElement())
return innerTextElement()->scrollTop();
return RenderBlock::scrollTop();
}
-void RenderTextControlSingleLine::setScrollLeft(LayoutUnit newLeft)
+void RenderTextControlSingleLine::setScrollLeft(int newLeft)
{
if (innerTextElement())
innerTextElement()->setScrollLeft(newLeft);
}
-void RenderTextControlSingleLine::setScrollTop(LayoutUnit newTop)
+void RenderTextControlSingleLine::setScrollTop(int newTop)
{
if (innerTextElement())
innerTextElement()->setScrollTop(newTop);
Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (101044 => 101045)
--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h 2011-11-23 07:12:57 UTC (rev 101044)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h 2011-11-23 08:21:18 UTC (rev 101045)
@@ -66,12 +66,12 @@
virtual void autoscroll();
// Subclassed to forward to our inner div.
- virtual LayoutUnit scrollLeft() const;
- virtual LayoutUnit scrollTop() const;
- virtual LayoutUnit scrollWidth() const;
- virtual LayoutUnit scrollHeight() const;
- virtual void setScrollLeft(LayoutUnit);
- virtual void setScrollTop(LayoutUnit);
+ virtual int scrollLeft() const;
+ virtual int scrollTop() const;
+ virtual int scrollWidth() const;
+ virtual int scrollHeight() const;
+ virtual void setScrollLeft(int);
+ virtual void setScrollTop(int);
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);