Index: Source/core/frame/LocalDOMWindow.cpp |
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp |
index 0c636c0bd315c613ab58748e3a472d3563458a3d..29797474e489309e0c86ccca7cdfd7eb306add47 100644 |
--- a/Source/core/frame/LocalDOMWindow.cpp |
+++ b/Source/core/frame/LocalDOMWindow.cpp |
@@ -1210,7 +1210,8 @@ void LocalDOMWindow::scrollTo(double x, double y) const |
if (!isCurrentlyDisplayedInFrame()) |
return; |
- document()->updateLayoutIgnorePendingStylesheets(); |
+ if (x || y) |
Rick Byers
2015/04/09 17:46:11
can you add a brief comment saying why? I.e. 'For
rune
2015/04/09 21:45:05
Done.
|
+ document()->updateLayoutIgnorePendingStylesheets(); |
if (std::isnan(x) || std::isnan(y)) |
return; |
@@ -1224,8 +1225,6 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const |
if (!isCurrentlyDisplayedInFrame()) |
return; |
- document()->updateLayoutIgnorePendingStylesheets(); |
- |
FrameView* view = frame()->view(); |
if (!view) |
return; |
@@ -1234,6 +1233,13 @@ void LocalDOMWindow::scrollTo(const ScrollToOptions& scrollToOptions) const |
if (!host) |
return; |
+ if (!scrollToOptions.hasLeft() |
+ || !scrollToOptions.hasTop() |
+ || scrollToOptions.left() |
+ || scrollToOptions.top()) { |
+ document()->updateLayoutIgnorePendingStylesheets(); |
+ } |
+ |
double scaledX = 0.0; |
double scaledY = 0.0; |