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

Unified Diff: Source/core/html/HTMLBodyElement.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 | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLBodyElement.cpp
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index ecf39231e90c8bee182b61938d351ffe0d36ffd0..eed6b0ccc044ff4651261af1214e5e0907678360 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -253,6 +253,12 @@ static int adjustForZoom(int value, Document* document)
int HTMLBodyElement::scrollLeft()
{
+ // FIXME: The specification is not clear about what is the expected behavior here:
+ // http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft
+ // Blink bails out in order to match other engines' behavior (WebKit, IE, Firefox and Opera12).
+ if (!document().inQuirksMode())
+ return 0;
+
// Update the document's layout.
Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
@@ -275,6 +281,12 @@ void HTMLBodyElement::setScrollLeft(int scrollLeft)
int HTMLBodyElement::scrollTop()
{
+ // FIXME: The specification is not clear about what is the expected behavior here:
+ // http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop .
+ // Blink bails out in order to match other engines' behavior (WebKit, IE, Firefox and Opera12).
+ if (!document().inQuirksMode())
+ return 0;
+
// Update the document's layout.
Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698