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

Unified Diff: LayoutTests/fast/scrolling/scroll-max-value.html

Issue 400633005: Use LayoutUnit::fromFloatRound for setting scroll values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « no previous file | LayoutTests/fast/scrolling/scroll-max-value-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/scrolling/scroll-max-value.html
diff --git a/LayoutTests/fast/scrolling/scroll-max-value.html b/LayoutTests/fast/scrolling/scroll-max-value.html
new file mode 100644
index 0000000000000000000000000000000000000000..d234da9a43551e40ff912c1145d03e8fd809aaba
--- /dev/null
+++ b/LayoutTests/fast/scrolling/scroll-max-value.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ #test {
+ width: 300px;
+ height: 300px;
+ overflow: auto;
+ border: 1px solid silver;
+ }
+ #test > article {
+ width: 1000px;
+ height: 1000px;
+ position: relative;
+ }
+ #top-left {
+ position: absolute;
+ top: 0;
+ left: 0;
+ }
+ #bottom-right {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ }
+ </style>
+ <script src="../../resources/js-test.js"></script>
+ </head>
+ <body>
+ <section id="test">
+ <article>
+ <span id="top-left">top left</span>
+ <span id="bottom-right">bottom right</span>
+ </article>
+ </section>
+ <p>
+ Tests that large scrollLeft/Top values aren't being ignored.
+ </p>
+ <script>
+ var el = document.getElementById('test');
+ el.scrollLeft = 100000000;
+ el.scrollTop = 100000000;
+
+ var expectedScrollLeft = el.firstElementChild.offsetWidth -
+ el.clientWidth;
+ if (el.scrollLeft == expectedScrollLeft) {
+ testPassed('Setting el.scrollLeft = 100000000 scrolls all ' +
+ 'the way to the right.');
+ } else {
+ testFailed('Setting el.scrollLeft = 100000000 scrolls to ' +
+ el.scrollLeft + ', expected ' + expectedScrollLeft + '.');
+ }
+
+ var expectedScrollTop = el.firstElementChild.offsetHeight -
+ el.clientHeight;
+ if (el.scrollTop == expectedScrollTop) {
+ testPassed('Setting el.scrollTop = 100000000 scrolls all ' +
+ 'the way to the bottom.');
+ } else {
+ testFailed('Setting el.scrollTop = 100000000 scrolls to ' +
+ el.scrollTop + ', expected ' + expectedScrollTop + '.');
+ }
+ </script>
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scroll-max-value-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698