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

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

Issue 51553002: Fix body.scrollTop/Left for scrollable <body> tags (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index f06a9b6859179c198baf53422c98ad091bbb39fa..bb0a6d4e2e1766c6250794fdba00d8161d8b06ae 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -730,12 +730,6 @@ void Element::setScrollLeft(int newLeft)
if (!view)
return;
- // WHATWG spec says [1]: "If the element is the root element invoke scroll()
- // with x as first argument and zero as second". Blink intentionally matches
- // other engine's behaviors here, instead, where the 'y' scroll position is
- // preversed. See [2].
- // [1] http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft
- // [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=23448
view->setScrollPosition(IntPoint(static_cast<int>(newLeft * frame->pageZoomFactor()), view->scrollY()));
}
@@ -758,12 +752,6 @@ void Element::setScrollTop(int newTop)
if (!view)
return;
- // WHATWG spec says [1]: "If the element is the root element invoke scroll()
- // with zero as first argument and y as second". Blink intentionally
- // matches other engine's behaviors here, instead, where the 'x' scroll
- // position is preversed. See [2].
- // [1] http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop
- // [2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=23448
view->setScrollPosition(IntPoint(view->scrollX(), static_cast<int>(newTop * frame->pageZoomFactor())));
}

Powered by Google App Engine
This is Rietveld 408576698