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

Unified Diff: third_party/WebKit/LayoutTests/fast/scrolling/jquery-rtl-scroll-type.html

Issue 2893833004: When moving past a left-hand scrollbar, don't jump way outside the content box. (Closed)
Patch Set: Created 3 years, 7 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: third_party/WebKit/LayoutTests/fast/scrolling/jquery-rtl-scroll-type.html
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/jquery-rtl-scroll-type.html b/third_party/WebKit/LayoutTests/fast/scrolling/jquery-rtl-scroll-type.html
new file mode 100644
index 0000000000000000000000000000000000000000..b230eba62f57ab6fa9c59e9c03eecc74b8ad8627
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/jquery-rtl-scroll-type.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!-- Inspired by https://github.com/othree/jquery.rtl-scroll-type which is used
+ in various JS frameworks to determine what scroll "type" the engine has
+ when it comes to RTL. When at the initial scroll position (i.e. all the way
+ to the right), some engines sets scrollLeft to 0 and decrement to negative
+ values when scrolling leftwards (Gecko). Others set it to 0 and increment
+ the value when scrolling leftwards (IE / Edge). Others again set it to the
+ width of the scrollable area and decrement it when scrolling leftwards
+ (Blink / WebKit). There are further complications in the latter engine if
+ there's a vertical scrollbar [1], and it's wider than the border box. All
+ we need to worry about here though, is that the script is able to detect
+ that we are "default".
+
+ [1] crbug.com/724255 -->
+<div id="definer" dir="rtl" style="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll">A</div>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+ // This test is only expected to pass in Blink / WebKit.
+ test(function() {
+ var definer = document.getElementById('definer');
+ var type = 'reverse';
+ if (definer.scrollLeft > 0) {
+ type = 'default';
+ }
+ else {
+ definer.scrollLeft = 1;
+ if (definer.scrollLeft === 0) {
+ type = 'negative';
+ }
+ }
+ assert_equals(type, 'default');
+ }, "Blink should have 'default' RTL scroll behavior");
+</script>

Powered by Google App Engine
This is Rietveld 408576698