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

Unified Diff: Source/core/html/HTMLBodyElement.cpp

Issue 26489005: Relax HTMLBodyElement's scrollTop/Left property set and get operations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@issue_290895
Patch Set: Relax HTMLBodyElement's scrollTop/Left property set and get operations. 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/jquery/offset-expected.txt ('k') | Source/core/page/UseCounter.h » ('j') | 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 f18e09ed1e0be5ca31b3316d6f4e3fa69680ac0c..df675668b1444246b7476bfd9b9a0da629083685 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -253,14 +253,16 @@ static int adjustForZoom(int value, Document* document)
int HTMLBodyElement::scrollLeft()
{
+ Document& document = this->document();
+
// 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;
+ if (!document.inQuirksMode())
+ UseCounter::countDeprecation(&document, UseCounter::ScrollLeftBody);
+ else
+ UseCounter::count(&document, UseCounter::ScrollLeftBody);
- // Update the document's layout.
- Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
FrameView* view = document.view();
return view ? adjustForZoom(view->scrollX(), &document) : 0;
@@ -268,10 +270,13 @@ int HTMLBodyElement::scrollLeft()
void HTMLBodyElement::setScrollLeft(int scrollLeft)
{
- if (!document().inQuirksMode())
- return;
-
Document& document = this->document();
+
+ if (!document.inQuirksMode())
+ UseCounter::countDeprecation(&document, UseCounter::ScrollLeftBody);
+ else
+ UseCounter::count(&document, UseCounter::ScrollLeftBody);
+
document.updateLayoutIgnorePendingStylesheets();
Frame* frame = document.frame();
if (!frame)
@@ -284,14 +289,16 @@ void HTMLBodyElement::setScrollLeft(int scrollLeft)
int HTMLBodyElement::scrollTop()
{
+ Document& document = this->document();
+
// 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;
+ // Blink should bail out in order to match other engines' behavior (WebKit, IE, Firefox and Opera12).
+ if (!document.inQuirksMode())
+ UseCounter::countDeprecation(&document, UseCounter::ScrollTopBody);
+ else
+ UseCounter::count(&document, UseCounter::ScrollTopBody);
- // Update the document's layout.
- Document& document = this->document();
document.updateLayoutIgnorePendingStylesheets();
FrameView* view = document.view();
return view ? adjustForZoom(view->scrollY(), &document) : 0;
@@ -299,10 +306,13 @@ int HTMLBodyElement::scrollTop()
void HTMLBodyElement::setScrollTop(int scrollTop)
{
- if (!document().inQuirksMode())
- return;
-
Document& document = this->document();
+
+ if (!document.inQuirksMode())
+ UseCounter::countDeprecation(&document, UseCounter::ScrollTopBody);
+ else
+ UseCounter::count(&document, UseCounter::ScrollTopBody);
+
document.updateLayoutIgnorePendingStylesheets();
Frame* frame = document.frame();
if (!frame)
« no previous file with comments | « LayoutTests/jquery/offset-expected.txt ('k') | Source/core/page/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698