Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: Source/core/dom/Element.cpp

Issue 25039006: document.documentElement.scrollTop/Left is zero (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: document.documentElement.scrollTop/Left is zero Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/rubberbanding/momentum-reset.html ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 33e024fb45e4adb6765ed5de9a824a28b974d0ff..295cd9fbd11ba889a4b3ea5cb7741a1f3759ccc6 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -686,6 +686,17 @@ int Element::clientHeight()
int Element::scrollLeft()
{
document().updateLayoutIgnorePendingStylesheets();
+
+ if (document().documentElement() == this) {
+ if (document().inQuirksMode())
+ return 0;
+
+ if (FrameView* view = document().view()) {
+ if (RenderView* renderView = document().renderView())
+ return adjustForAbsoluteZoom(view->scrollX(), renderView);
+ }
+ }
+
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollLeft(), rend);
return 0;
@@ -694,6 +705,17 @@ int Element::scrollLeft()
int Element::scrollTop()
{
document().updateLayoutIgnorePendingStylesheets();
+
+ if (document().documentElement() == this) {
+ if (document().inQuirksMode())
+ return 0;
+
+ if (FrameView* view = document().view()) {
+ if (RenderView* renderView = document().renderView())
+ return adjustForAbsoluteZoom(view->scrollY(), renderView);
+ }
+ }
+
if (RenderBox* rend = renderBox())
return adjustForAbsoluteZoom(rend->scrollTop(), rend);
return 0;
« no previous file with comments | « LayoutTests/rubberbanding/momentum-reset.html ('k') | Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698