Diff
Modified: trunk/Source/WebCore/ChangeLog (88177 => 88178)
--- trunk/Source/WebCore/ChangeLog 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/ChangeLog 2011-06-06 19:21:32 UTC (rev 88178)
@@ -1,3 +1,36 @@
+2011-06-06 Peter Kasting <[email protected]>
+
+ Reviewed by Antonio Gomes.
+
+ Remove unnecessary args from scroll functions.
+ https://bugs.webkit.org/show_bug.cgi?id=61648
+
+ No behavior change, so no tests.
+
+ * WebCore.exp.in:
+ * WebCore.order:
+ * dom/Element.cpp:
+ (WebCore::Element::scrollIntoView):
+ (WebCore::Element::scrollIntoViewIfNeeded):
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::revealSelection):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMousePressEvent):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollToAnchor):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::canBeScrolledAndHasScrollableArea):
+ (WebCore::RenderBox::canBeProgramaticallyScrolled):
+ * rendering/RenderBox.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollRectToVisible):
+ (WebCore::RenderLayer::autoscroll):
+ * rendering/RenderLayer.h:
+ * rendering/RenderListBox.h:
+ (WebCore::RenderListBox::canBeProgramaticallyScrolled):
+ * rendering/RenderTextControl.h:
+ (WebCore::RenderTextControl::canBeProgramaticallyScrolled):
+
2011-06-06 Levi Weintraub <[email protected]>
Reviewed by Eric Seidel.
Modified: trunk/Source/WebCore/WebCore.exp.in (88177 => 88178)
--- trunk/Source/WebCore/WebCore.exp.in 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/WebCore.exp.in 2011-06-06 19:21:32 UTC (rev 88178)
@@ -215,7 +215,7 @@
__ZN7WebCore11MemoryCache14evictResourcesEv
__ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
__ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE
-__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
+__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectERKNS_15ScrollAlignmentES6_
__ZN7WebCore11globalPointERK8_NSPointP8NSWindow
__ZN7WebCore11memoryCacheEv
__ZN7WebCore11startOfWordERKNS_15VisiblePositionENS_9EWordSideE
Modified: trunk/Source/WebCore/WebCore.order (88177 => 88178)
--- trunk/Source/WebCore/WebCore.order 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/WebCore.order 2011-06-06 19:21:32 UTC (rev 88178)
@@ -4208,7 +4208,7 @@
__ZNK7WebCore10RenderView19mapLocalToContainerEPNS_20RenderBoxModelObjectEbbRNS_14TransformStateE
__ZN7WebCore14TransformState7flattenEv
__ZNK7WebCore13ContainerNode19getLowerRightCornerERNS_10FloatPointE
-__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
+__ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectERKNS_15ScrollAlignmentES6_
__ZN7WebCore11RenderLayer15getRectToExposeERKNS_7IntRectES3_RKNS_15ScrollAlignmentES6_
__ZNK7WebCore9RenderBox28canBeProgramaticallyScrolledEb
__ZN7WebCore9FrameView17setScrollPositionERKNS_8IntPointE
Modified: trunk/Source/WebCore/dom/Element.cpp (88177 => 88178)
--- trunk/Source/WebCore/dom/Element.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/dom/Element.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -282,9 +282,9 @@
IntRect bounds = getRect();
// Align to the top / bottom and to the closest edge.
if (alignToTop)
- renderer()->enclosingLayer()->scrollRectToVisible(bounds, false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
+ renderer()->enclosingLayer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
else
- renderer()->enclosingLayer()->scrollRectToVisible(bounds, false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);
+ renderer()->enclosingLayer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignBottomAlways);
}
void Element::scrollIntoViewIfNeeded(bool centerIfNeeded)
@@ -296,9 +296,9 @@
IntRect bounds = getRect();
if (centerIfNeeded)
- renderer()->enclosingLayer()->scrollRectToVisible(bounds, false, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
+ renderer()->enclosingLayer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
else
- renderer()->enclosingLayer()->scrollRectToVisible(bounds, false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+ renderer()->enclosingLayer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
}
void Element::scrollByUnits(int units, ScrollGranularity granularity)
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (88177 => 88178)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -1881,7 +1881,7 @@
// the selection rect could intersect more than just that.
// See <rdar://problem/4799899>.
if (RenderLayer* layer = start.deprecatedNode()->renderer()->enclosingLayer()) {
- layer->scrollRectToVisible(rect, false, alignment, alignment);
+ layer->scrollRectToVisible(rect, alignment, alignment);
updateAppearance();
}
}
Modified: trunk/Source/WebCore/page/EventHandler.cpp (88177 => 88178)
--- trunk/Source/WebCore/page/EventHandler.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -519,7 +519,7 @@
swallowEvent = handleMousePressEventSingleClick(event);
m_mouseDownMayStartAutoscroll = m_mouseDownMayStartSelect
- || (m_mousePressNode && m_mousePressNode->renderBox() && m_mousePressNode->renderBox()->canBeProgramaticallyScrolled(true));
+ || (m_mousePressNode && m_mousePressNode->renderBox() && m_mousePressNode->renderBox()->canBeProgramaticallyScrolled());
return swallowEvent;
}
Modified: trunk/Source/WebCore/page/FrameView.cpp (88177 => 88178)
--- trunk/Source/WebCore/page/FrameView.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/page/FrameView.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -1948,7 +1948,7 @@
// Scroll nested layers and frames to reveal the anchor.
// Align to the top and to the closest side (this matches other browsers).
- anchorNode->renderer()->enclosingLayer()->scrollRectToVisible(rect, true, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
+ anchorNode->renderer()->enclosingLayer()->scrollRectToVisible(rect, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignTopAlways);
if (AXObjectCache::accessibilityEnabled())
m_frame->document()->axObjectCache()->handleScrolledToAnchor(anchorNode.get());
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -641,10 +641,10 @@
bool RenderBox::canBeScrolledAndHasScrollableArea() const
{
- return canBeProgramaticallyScrolled(false) && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
+ return canBeProgramaticallyScrolled() && (scrollHeight() != clientHeight() || scrollWidth() != clientWidth());
}
-bool RenderBox::canBeProgramaticallyScrolled(bool) const
+bool RenderBox::canBeProgramaticallyScrolled() const
{
return (hasOverflowClip() && (scrollsOverflow() || (node() && node()->rendererIsEditable()))) || (node() && node()->isDocumentNode());
}
Modified: trunk/Source/WebCore/rendering/RenderBox.h (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-06-06 19:21:32 UTC (rev 88178)
@@ -333,7 +333,7 @@
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;
- virtual bool canBeProgramaticallyScrolled(bool) const;
+ virtual bool canBeProgramaticallyScrolled() const;
virtual void autoscroll();
virtual void stopAutoscroll() { }
virtual void panScroll(const IntPoint&);
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-06 19:21:32 UTC (rev 88178)
@@ -1378,11 +1378,10 @@
renderer()->node()->document()->eventQueue()->enqueueOrDispatchScrollEvent(renderer()->node(), EventQueue::ScrollEventElementTarget);
}
-void RenderLayer::scrollRectToVisible(const IntRect& rect, bool scrollToAnchor, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
+void RenderLayer::scrollRectToVisible(const IntRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
{
RenderLayer* parentLayer = 0;
IntRect newRect = rect;
- int xOffset = 0, yOffset = 0;
// We may end up propagating a scroll event. It is important that we suspend events until
// the end of the function since they could delete the layer or the layer's renderer().
@@ -1408,8 +1407,8 @@
IntRect exposeRect = IntRect(rect.x() + scrollXOffset(), rect.y() + scrollYOffset(), rect.width(), rect.height());
IntRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY);
- xOffset = r.x() - absPos.x();
- yOffset = r.y() - absPos.y();
+ int xOffset = r.x() - absPos.x();
+ int yOffset = r.y() - absPos.y();
// Adjust offsets if they're outside of the allowable range.
xOffset = max(0, min(scrollWidth() - layerBounds.width(), xOffset));
yOffset = max(0, min(scrollHeight() - layerBounds.height(), yOffset));
@@ -1423,14 +1422,14 @@
newRect.setX(rect.x() - diffX);
newRect.setY(rect.y() - diffY);
}
- } else if (!parentLayer && renderer()->isBox() && renderBox()->canBeProgramaticallyScrolled(scrollToAnchor)) {
+ } else if (!parentLayer && renderer()->isBox() && renderBox()->canBeProgramaticallyScrolled()) {
if (frameView) {
if (renderer()->document() && renderer()->document()->ownerElement() && renderer()->document()->ownerElement()->renderer()) {
IntRect viewRect = frameView->visibleContentRect();
IntRect r = getRectToExpose(viewRect, rect, alignX, alignY);
- xOffset = r.x();
- yOffset = r.y();
+ int xOffset = r.x();
+ int yOffset = r.y();
// Adjust offsets if they're outside of the allowable range.
xOffset = max(0, min(frameView->contentsWidth(), xOffset));
yOffset = max(0, min(frameView->contentsHeight(), yOffset));
@@ -1459,7 +1458,7 @@
}
if (parentLayer)
- parentLayer->scrollRectToVisible(newRect, scrollToAnchor, alignX, alignY);
+ parentLayer->scrollRectToVisible(newRect, alignX, alignY);
if (frameView)
frameView->resumeScheduledEvents();
@@ -1553,7 +1552,7 @@
#endif
IntPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->currentMousePosition());
- scrollRectToVisible(IntRect(currentDocumentPosition, IntSize(1, 1)), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+ scrollRectToVisible(IntRect(currentDocumentPosition, IntSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
}
void RenderLayer::resize(const PlatformMouseEvent& evt, const IntSize& oldOffset)
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2011-06-06 19:21:32 UTC (rev 88178)
@@ -236,7 +236,7 @@
void scrollToOffset(int x, int y);
void scrollToXOffset(int x) { scrollToOffset(x, scrollYOffset()); }
void scrollToYOffset(int y) { scrollToOffset(scrollXOffset(), y); }
- void scrollRectToVisible(const IntRect&, bool scrollToAnchor = false, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);
+ void scrollRectToVisible(const IntRect&, const ScrollAlignment& alignX = ScrollAlignment::alignCenterIfNeeded, const ScrollAlignment& alignY = ScrollAlignment::alignCenterIfNeeded);
IntRect getRectToExpose(const IntRect& visibleRect, const IntRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY);
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2011-06-06 19:21:32 UTC (rev 88178)
@@ -81,7 +81,7 @@
virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
- virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
+ virtual bool canBeProgramaticallyScrolled() const { return true; }
virtual void autoscroll();
virtual void stopAutoscroll();
Modified: trunk/Source/WebCore/rendering/RenderTextControl.h (88177 => 88178)
--- trunk/Source/WebCore/rendering/RenderTextControl.h 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebCore/rendering/RenderTextControl.h 2011-06-06 19:21:32 UTC (rev 88178)
@@ -94,7 +94,7 @@
virtual void addFocusRingRects(Vector<IntRect>&, const IntPoint&);
- virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
+ virtual bool canBeProgramaticallyScrolled() const { return true; }
virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
Modified: trunk/Source/WebKit/mac/ChangeLog (88177 => 88178)
--- trunk/Source/WebKit/mac/ChangeLog 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebKit/mac/ChangeLog 2011-06-06 19:21:32 UTC (rev 88178)
@@ -1,3 +1,13 @@
+2011-06-06 Peter Kasting <[email protected]>
+
+ Reviewed by Antonio Gomes.
+
+ Remove unnecessary args from scroll functions.
+ https://bugs.webkit.org/show_bug.cgi?id=61648
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _scrollDOMRangeToVisible:]):
+
2011-06-06 Alexandru Chiculita <[email protected]>
Reviewed by Kent Tamura.
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (88177 => 88178)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2011-06-06 18:51:32 UTC (rev 88177)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2011-06-06 19:21:32 UTC (rev 88178)
@@ -643,7 +643,7 @@
if (startNode && startNode->renderer()) {
RenderLayer *layer = startNode->renderer()->enclosingLayer();
if (layer)
- layer->scrollRectToVisible(enclosingIntRect(rangeRect), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
+ layer->scrollRectToVisible(enclosingIntRect(rangeRect), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
}
}