Diff
Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog 2016-01-18 11:36:45 UTC (rev 195196)
@@ -1,3 +1,18 @@
+2015-12-23 Simon Fraser <[email protected]>
+
+ REGRESSION (r187593): Scroll position jumps when selecting text in an iframe
+ https://bugs.webkit.org/show_bug.cgi?id=152541
+ rdar://problem/23886181
+
+ Reviewed by Tim Horton.
+
+ New test for autoscrolling iframe contents (an existing test scrolled an overflow:scroll
+ inside an iframe, and didn't catch the bug).
+
+ * fast/events/autoscroll-in-iframe-body-expected.txt: Added.
+ * fast/events/autoscroll-in-iframe-body.html: Added.
+ * fast/forms/input-readonly-autoscroll.html: Fix a missing double quote.
+
2015-12-22 Simon Fraser <[email protected]>
Minor cleanup in RenderBox::canBeProgramaticallyScrolled()
Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body-expected.txt (0 => 195196)
--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body-expected.txt 2016-01-18 11:36:45 UTC (rev 195196)
@@ -0,0 +1,3 @@
+
+PASSED: selecting in the iframe did not scroll the page.
+
Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body.html (0 => 195196)
--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body.html (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/events/autoscroll-in-iframe-body.html 2016-01-18 11:36:45 UTC (rev 195196)
@@ -0,0 +1,96 @@
+<html>
+ <head>
+ <style>
+ body {
+ height: 2000px;
+ }
+ iframe {
+ position: absolute;
+ top: 800px;
+ }
+ </style>
+ <script src=""
+ <script>
+
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+
+ function log(msg)
+ {
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+ }
+
+ var verticalScrollOffset;
+ var iframe;
+ var mainFrameScrollOffset = 400;
+
+ function getDragStart()
+ {
+ iframe = document.getElementById('targetFrame');
+ // Start dragging near the bottom of the iframe.
+ return {
+ 'x' : iframe.clientLeft + iframe.clientWidth / 2,
+ 'y' : iframe.clientTop + iframe.clientHeight - 10
+ };
+ }
+
+ function doTest()
+ {
+ document.scrollingElement.scrollTop = mainFrameScrollOffset;
+ if (document.scrollingElement.scrollTop != mainFrameScrollOffset)
+ log("FAILED: failed to scroll by " + mainFrameScrollOffset + "px");
+
+ iframe = document.getElementById('targetFrame');
+ // Start dragging near the bottom of the iframe.
+ var startPoint = getDragStart();
+ if (window.eventSender) {
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(startPoint.x, startPoint.y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+ setTimeout(autoscrollTestPart1, 0);
+ }
+
+ function autoscrollTestPart1()
+ {
+ var mainDocumentTop = document.scrollingElement.scrollTop;
+ if (mainDocumentTop != mainFrameScrollOffset)
+ log("FAILED: Clicking in the iframe scrolled the page (window.scrollTop is " + mainDocumentTop + ")");
+
+ if (window.eventSender) {
+ var startPoint = getDragStart();
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(startPoint.x, startPoint.y);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(startPoint.x + 10, startPoint.y);
+ }
+ setTimeout(autoscrollTestPart2, 100);
+ }
+
+ function autoscrollTestPart2()
+ {
+ if (window.eventSender)
+ eventSender.mouseUp();
+
+ var mainDocumentTop = document.scrollingElement.scrollTop;
+ if (mainDocumentTop == mainFrameScrollOffset)
+ log("PASSED: selecting in the iframe did not scroll the page.");
+ else
+ log("FAILED: the page autoscrolled (window.scrollTop is " + mainDocumentTop + ").");
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+ </head>
+<body>
+ <iframe id="targetFrame" src="" ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, c
onsectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."></iframe>
+ <div id="console"></div>
+</body>
+</html>
+
Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/forms/input-readonly-autoscroll.html (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/forms/input-readonly-autoscroll.html 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/forms/input-readonly-autoscroll.html 2016-01-18 11:36:45 UTC (rev 195196)
@@ -38,7 +38,7 @@
</script>
</head>
<body _onload_="test()">
- <p>Test for <a href="" 11534</a>.</p>
+ <p>Test for <a href="" 11534</a>.</p>
<p>Readonly text fields don't scroll when selecting content.</p>
<input id="tf" readonly value="abcdefghijklmnopqrstuvwxyz"></input>
<div id="res"></div>
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog 2016-01-18 11:36:45 UTC (rev 195196)
@@ -1,3 +1,59 @@
+2015-12-23 Simon Fraser <[email protected]>
+
+ REGRESSION (r187593): Scroll position jumps when selecting text in an iframe
+ https://bugs.webkit.org/show_bug.cgi?id=152541
+ rdar://problem/23886181
+
+ Reviewed by Tim Horton.
+
+ r154382 added code that modifies parentLayer traversal, looking for ancestor
+ scrollable layers. However, it confusingly added another code path in which
+ the ancestor layer traversal cross a frame boundary, when RenderLayer::scrollRectToVisible()
+ already has one. I fixed this new location to adjust the rect coordinates in r187593,
+ but then code that hit both crossing points double-mapped the coordinates, causing
+ autoscroll jumping.
+
+ Fix by reverting r154382 and r187593, going back to doing the ancestor walk in
+ one place. Re-fix r154382 by implementing RenderLayer::allowsCurrentScroll(),
+ which contains the logic for line clamp, autoscroll and ensuring that overflow:hidden
+ can be programmatically scrolled.
+
+ Form controls are special; they can have overflow:hidden but still be user-scrollable
+ during autoscroll; this is handled via the confusingly-named canBeProgramaticallyScrolled().
+ RenderTextControlSingleLine implements this to ensure that readonly text inputs
+ autoscroll (which is exercised by a test).
+
+ The frame-to-parent-frame rect mapping in RenderLayer::scrollRectToVisible() is
+ fixed to use the coordinate mapping functions from Widget/ScrollView, with the
+ addition of a new utility function contentsToContainingViewContents().
+
+ A "Scrolling" logging channel is added with a few log points.
+
+ Test: fast/events/autoscroll-in-iframe-body.html
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
+ use contentsToContainingViewContents().
+ * platform/Logging.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::contentsToContainingViewContents):
+ * platform/ScrollView.h:
+ * platform/graphics/IntPoint.cpp:
+ (WebCore::IntPoint::constrainedBetween): New helper to constrain a point between
+ two other points.
+ * platform/graphics/IntPoint.h:
+ (WebCore::IntPoint::expandedTo):
+ (WebCore::IntPoint::shrunkTo):
+ * rendering/RenderBox.cpp:
+ * rendering/RenderLayer.cpp:
+ (WebCore::parentLayerCrossFrame):
+ (WebCore::RenderLayer::enclosingScrollableLayer):
+ (WebCore::frameElementAndViewPermitScroll):
+ (WebCore::RenderLayer::allowsCurrentScroll):
+ (WebCore::RenderLayer::scrollRectToVisible):
+ * rendering/RenderLayer.h:
+ * rendering/RenderTextControlSingleLine.h:
+
2015-12-22 Simon Fraser <[email protected]>
Minor cleanup in RenderBox::canBeProgramaticallyScrolled()
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2016-01-18 11:36:45 UTC (rev 195196)
@@ -155,9 +155,7 @@
Region subframeRegion = absoluteNonFastScrollableRegionForFrame(*subframe);
// Map from the frame document to our document.
- IntPoint offset = subframeView->contentsToView(IntPoint());
- offset = subframeView->convertToContainingView(offset);
- offset = frameView->viewToContents(offset);
+ IntPoint offset = subframeView->contentsToContainingViewContents(IntPoint());
// FIXME: this translation ignores non-trival transforms on the frame.
subframeRegion.translate(toIntSize(offset));
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/Logging.h (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/Logging.h 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/Logging.h 2016-01-18 11:36:45 UTC (rev 195196)
@@ -70,6 +70,7 @@
M(SQLDatabase) \
M(SVG) \
M(Services) \
+ M(Scrolling) \
M(SpellingAndGrammar) \
M(StorageAPI) \
M(Threading) \
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp 2016-01-18 11:36:45 UTC (rev 195196)
@@ -29,11 +29,13 @@
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
#include "HostWindow.h"
+#include "Logging.h"
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
#include "ScrollAnimator.h"
#include "Scrollbar.h"
#include "ScrollbarTheme.h"
+#include "TextStream.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -877,6 +879,26 @@
return rect;
}
+IntPoint ScrollView::contentsToContainingViewContents(const IntPoint& point) const
+{
+ if (const ScrollView* parentScrollView = parent()) {
+ IntPoint pointInContainingView = convertToContainingView(contentsToView(point));
+ return parentScrollView->viewToContents(pointInContainingView);
+ }
+
+ return contentsToView(point);
+}
+
+IntRect ScrollView::contentsToContainingViewContents(IntRect rect) const
+{
+ if (const ScrollView* parentScrollView = parent()) {
+ IntRect rectInContainingView = convertToContainingView(contentsToView(rect));
+ return parentScrollView->viewToContents(rectInContainingView);
+ }
+
+ return contentsToView(rect);
+}
+
IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
{
if (delegatesScrolling())
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.h (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.h 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.h 2016-01-18 11:36:45 UTC (rev 195196)
@@ -294,6 +294,9 @@
IntRect viewToContents(IntRect) const;
IntRect contentsToView(IntRect) const;
+ IntPoint contentsToContainingViewContents(const IntPoint&) const;
+ IntRect contentsToContainingViewContents(IntRect) const;
+
WEBCORE_EXPORT IntPoint rootViewToTotalContents(const IntPoint&) const;
// Event coordinates are assumed to be in the coordinate space of a window that contains
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.cpp (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.cpp 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.cpp 2016-01-18 11:36:45 UTC (rev 195196)
@@ -42,4 +42,12 @@
{
}
+IntPoint IntPoint::constrainedBetween(const IntPoint& min, const IntPoint& max) const
+{
+ return {
+ std::max(min.x(), std::min(max.x(), m_x)),
+ std::max(min.y(), std::min(max.y(), m_y))
+ };
}
+
+}
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.h (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.h 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/graphics/IntPoint.h 2016-01-18 11:36:45 UTC (rev 195196)
@@ -83,16 +83,22 @@
IntPoint expandedTo(const IntPoint& other) const
{
- return IntPoint(m_x > other.m_x ? m_x : other.m_x,
- m_y > other.m_y ? m_y : other.m_y);
+ return {
+ m_x > other.m_x ? m_x : other.m_x,
+ m_y > other.m_y ? m_y : other.m_y
+ };
}
IntPoint shrunkTo(const IntPoint& other) const
{
- return IntPoint(m_x < other.m_x ? m_x : other.m_x,
- m_y < other.m_y ? m_y : other.m_y);
+ return {
+ m_x < other.m_x ? m_x : other.m_x,
+ m_y < other.m_y ? m_y : other.m_y
+ };
}
+ IntPoint constrainedBetween(const IntPoint& min, const IntPoint& max) const;
+
int distanceSquaredToPoint(const IntPoint&) const;
void clampNegativeToZero()
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBox.cpp (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBox.cpp 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBox.cpp 2016-01-18 11:36:45 UTC (rev 195196)
@@ -915,6 +915,7 @@
return canBeScrolledAndHasScrollableArea();
}
+// FIXME: This is badly named. overflow:hidden can be programmatically scrolled, yet this returns false in that case.
bool RenderBox::canBeProgramaticallyScrolled() const
{
if (isRenderView())
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.cpp (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.cpp 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.cpp 2016-01-18 11:36:45 UTC (rev 195196)
@@ -1449,7 +1449,7 @@
return curr;
}
-static RenderLayer* parentLayerCrossFrame(const RenderLayer& layer, LayoutRect* rect = nullptr)
+static RenderLayer* parentLayerCrossFrame(const RenderLayer& layer)
{
if (layer.parent())
return layer.parent();
@@ -1462,18 +1462,12 @@
if (!ownerRenderer)
return nullptr;
- // Convert the rect into the coordinate space of the parent frame's document.
- if (rect) {
- IntRect viewRect = layer.renderer().frame().view()->convertToContainingView(enclosingIntRect(*rect));
- *rect = ownerRenderer->frame().view()->viewToContents(viewRect);
- }
-
return ownerRenderer->enclosingLayer();
}
-RenderLayer* RenderLayer::enclosingScrollableLayer(LayoutRect* rect) const
+RenderLayer* RenderLayer::enclosingScrollableLayer() const
{
- for (RenderLayer* nextLayer = parentLayerCrossFrame(*this, rect); nextLayer; nextLayer = parentLayerCrossFrame(*nextLayer, rect)) {
+ for (RenderLayer* nextLayer = parentLayerCrossFrame(*this); nextLayer; nextLayer = parentLayerCrossFrame(*nextLayer)) {
if (is<RenderBox>(nextLayer->renderer()) && downcast<RenderBox>(nextLayer->renderer()).canBeScrolledAndHasScrollableArea())
return nextLayer;
}
@@ -2278,6 +2272,7 @@
scrollByRecursively(adjustedScrollDelta(delta), ScrollOffsetClamped);
}
+// FIXME: unify with the scrollRectToVisible() code below.
void RenderLayer::scrollByRecursively(const IntSize& delta, ScrollOffsetClamping clamp, ScrollableArea** scrolledArea)
{
if (delta.isZero())
@@ -2434,21 +2429,44 @@
view.frameView().viewportContentsChanged();
}
-static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameElementBase, FrameView* frameView)
+static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameElementBase, FrameView& frameView)
{
// If scrollbars aren't explicitly forbidden, permit scrolling.
if (frameElementBase && frameElementBase->scrollingMode() != ScrollbarAlwaysOff)
return true;
// If scrollbars are forbidden, user initiated scrolls should obviously be ignored.
- if (frameView->wasScrolledByUser())
+ if (frameView.wasScrolledByUser())
return false;
// Forbid autoscrolls when scrollbars are off, but permits other programmatic scrolls,
// like navigation to an anchor.
- return !frameView->frame().eventHandler().autoscrollInProgress();
+ return !frameView.frame().eventHandler().autoscrollInProgress();
}
+bool RenderLayer::allowsCurrentScroll() const
+{
+ if (!renderer().hasOverflowClip())
+ return false;
+
+ // Don't scroll to reveal an overflow layer that is restricted by the -webkit-line-clamp property.
+ // FIXME: Is this still needed? It used to be relevant for Safari RSS.
+ if (renderer().parent() && !renderer().parent()->style().lineClamp().isNone())
+ return false;
+
+ RenderBox* box = renderBox();
+ ASSERT(box); // Only boxes can have overflowClip set.
+
+ if (renderer().frame().eventHandler().autoscrollInProgress()) {
+ // The "programmatically" here is misleading; this asks whether the box has scrollable overflow,
+ // or is a special case like a form control.
+ return box->canBeProgramaticallyScrolled();
+ }
+
+ // Programmatic scrolls can scroll overflow:hidden.
+ return box->hasHorizontalOverflow() || box->hasVerticalOverflow();
+}
+
void RenderLayer::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
{
RenderLayer* parentLayer = nullptr;
@@ -2458,13 +2476,10 @@
// the end of the function since they could delete the layer or the layer's renderer().
FrameView& frameView = renderer().view().frameView();
- bool restrictedByLineClamp = false;
- if (renderer().parent()) {
+ if (renderer().parent())
parentLayer = renderer().parent()->enclosingLayer();
- restrictedByLineClamp = !renderer().parent()->style().lineClamp().isNone();
- }
- if (renderer().hasOverflowClip() && !restrictedByLineClamp) {
+ if (allowsCurrentScroll()) {
// Don't scroll to reveal an overflow layer that is restricted by the -webkit-line-clamp property.
// This will prevent us from revealing text hidden by the slider in Safari RSS.
RenderBox* box = renderBox();
@@ -2481,7 +2496,7 @@
localExposeRect.move(-scrollOffsetDifference);
newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox());
}
- } else if (!parentLayer && renderer().isBox() && renderBox()->canBeProgramaticallyScrolled()) {
+ } else if (!parentLayer && renderer().isRenderView()) {
HTMLFrameOwnerElement* ownerElement = renderer().document().ownerElement();
if (ownerElement && ownerElement->renderer()) {
@@ -2490,23 +2505,19 @@
if (is<HTMLFrameElementBase>(*ownerElement))
frameElementBase = downcast<HTMLFrameElementBase>(ownerElement);
- if (frameElementAndViewPermitScroll(frameElementBase, &frameView)) {
+ if (frameElementAndViewPermitScroll(frameElementBase, frameView)) {
LayoutRect viewRect = frameView.visibleContentRect(LegacyIOSDocumentVisibleRect);
LayoutRect exposeRect = getRectToExpose(viewRect, viewRect, rect, alignX, alignY);
- int xOffset = roundToInt(exposeRect.x());
- int yOffset = roundToInt(exposeRect.y());
+ IntPoint scrollOffset(roundedIntPoint(exposeRect.location()));
// Adjust offsets if they're outside of the allowable range.
- xOffset = std::max(0, std::min(frameView.contentsWidth(), xOffset));
- yOffset = std::max(0, std::min(frameView.contentsHeight(), yOffset));
+ scrollOffset = scrollOffset.constrainedBetween(IntPoint(), IntPoint(frameView.contentsSize()));
+ frameView.setScrollPosition(scrollOffset);
- frameView.setScrollPosition(IntPoint(xOffset, yOffset));
if (frameView.safeToPropagateScrollToParent()) {
parentLayer = ownerElement->renderer()->enclosingLayer();
- // FIXME: This doesn't correctly convert the rect to
- // absolute coordinates in the parent.
- newRect.setX(rect.x() - frameView.scrollX() + frameView.x());
- newRect.setY(rect.y() - frameView.scrollY() + frameView.y());
+ // Convert the rect into the coordinate space of the parent frame's document.
+ newRect = frameView.contentsToContainingViewContents(enclosingIntRect(newRect));
} else
parentLayer = nullptr;
}
@@ -2535,9 +2546,6 @@
}
}
- if (renderer().frame().eventHandler().autoscrollInProgress())
- parentLayer = enclosingScrollableLayer(&newRect);
-
if (parentLayer)
parentLayer->scrollRectToVisible(newRect, alignX, alignY);
}
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.h (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.h 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderLayer.h 2016-01-18 11:36:45 UTC (rev 195196)
@@ -404,7 +404,7 @@
RenderLayer* enclosingAncestorForPosition(EPosition) const;
// Returns the nearest enclosing layer that is scrollable.
- RenderLayer* enclosingScrollableLayer(LayoutRect* = nullptr) const;
+ RenderLayer* enclosingScrollableLayer() const;
// The layer relative to which clipping rects for this layer are computed.
RenderLayer* clippingRootForPainting() const;
@@ -897,6 +897,8 @@
IntSize scrollbarOffset(const Scrollbar*) const;
void updateScrollableAreaSet(bool hasOverflow);
+
+ bool allowsCurrentScroll() const;
void dirtyAncestorChainVisibleDescendantStatus();
void setAncestorChainHasVisibleDescendant();
Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTextControlSingleLine.h (195195 => 195196)
--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTextControlSingleLine.h 2016-01-18 11:36:08 UTC (rev 195195)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderTextControlSingleLine.h 2016-01-18 11:36:45 UTC (rev 195196)
@@ -105,6 +105,7 @@
private:
virtual bool hasLineIfEmpty() const override { return true; }
virtual bool isTextControlInnerBlock() const override { return true; }
+ virtual bool canBeProgramaticallyScrolled() const override { return true; }
};
} // namespace WebCore