Index: Source/core/html/HTMLBodyElement.cpp |
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp |
index ad0cbb2c37199a28b50cae10dd131a994b7ed52a..fea40fa52585e639e91c9496606ff7df0b0945b8 100644 |
--- a/Source/core/html/HTMLBodyElement.cpp |
+++ b/Source/core/html/HTMLBodyElement.cpp |
@@ -205,18 +205,21 @@ static int adjustForZoom(int value, Document* document) |
return static_cast<int>(value / zoomFactor); |
} |
+// FIXME: There are cases where body.scrollLeft is allowed to return |
+// non-zero values in both quirks and strict mode. It happens when |
+// <body> has an overflow that is not the Frame overflow. |
+// http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft |
+// http://code.google.com/p/chromium/issues/detail?id=312435 |
int HTMLBodyElement::scrollLeft() |
{ |
Document& document = this->document(); |
+ document.updateLayoutIgnorePendingStylesheets(); |
- // FIXME: There are cases where body.scrollLeft is allowed to return |
- // non-zero values in both quirks and strict mode. It happens when |
- // <body> has an overflow that is not the Frame overflow. |
- // http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft |
- if (!document.inQuirksMode()) |
- UseCounter::countDeprecation(&document, UseCounter::ScrollLeftBodyNotQuirksMode); |
+ if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { |
+ if (!document.inQuirksMode()) |
+ return 0; |
+ } |
- document.updateLayoutIgnorePendingStylesheets(); |
FrameView* view = document.view(); |
return view ? adjustForZoom(view->scrollX(), &document) : 0; |
} |
@@ -224,11 +227,13 @@ int HTMLBodyElement::scrollLeft() |
void HTMLBodyElement::setScrollLeft(int scrollLeft) |
{ |
Document& document = this->document(); |
+ document.updateLayoutIgnorePendingStylesheets(); |
- if (!document.inQuirksMode()) |
- UseCounter::countDeprecation(&document, UseCounter::ScrollLeftBodyNotQuirksMode); |
+ if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { |
+ if (!document.inQuirksMode()) |
+ return; |
+ } |
- document.updateLayoutIgnorePendingStylesheets(); |
Frame* frame = document.frame(); |
if (!frame) |
return; |
@@ -241,15 +246,13 @@ void HTMLBodyElement::setScrollLeft(int scrollLeft) |
int HTMLBodyElement::scrollTop() |
{ |
Document& document = this->document(); |
+ document.updateLayoutIgnorePendingStylesheets(); |
- // FIXME: There are cases where body.scrollTop is allowed to return |
- // non-zero values in both quirks and strict mode. It happens when |
- // body has a overflow that is not the Frame overflow. |
- // http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop |
- if (!document.inQuirksMode()) |
- UseCounter::countDeprecation(&document, UseCounter::ScrollTopBodyNotQuirksMode); |
+ if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { |
+ if (!document.inQuirksMode()) |
+ return 0; |
+ } |
- document.updateLayoutIgnorePendingStylesheets(); |
FrameView* view = document.view(); |
return view ? adjustForZoom(view->scrollY(), &document) : 0; |
} |
@@ -257,11 +260,13 @@ int HTMLBodyElement::scrollTop() |
void HTMLBodyElement::setScrollTop(int scrollTop) |
{ |
Document& document = this->document(); |
+ document.updateLayoutIgnorePendingStylesheets(); |
- if (!document.inQuirksMode()) |
- UseCounter::countDeprecation(&document, UseCounter::ScrollTopBodyNotQuirksMode); |
+ if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) { |
+ if (!document.inQuirksMode()) |
+ return; |
+ } |
- document.updateLayoutIgnorePendingStylesheets(); |
Frame* frame = document.frame(); |
if (!frame) |
return; |