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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/focus_editable_html_element_scroll.html

Issue 1806423003: Convert editing/selection layout tests to use w3c test harness, volume 6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/editing/selection/focus_editable_html_element_scroll.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/focus_editable_html_element_scroll.html b/third_party/WebKit/LayoutTests/editing/selection/focus_editable_html_element_scroll.html
new file mode 100644
index 0000000000000000000000000000000000000000..9db363081b0646ca528c2c6790b15fcb1485493b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/focus_editable_html_element_scroll.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<html contenteditable>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<html contenteditable>
+<body style="overflow:hidden;">
+This test makes sure that we don't scroll unnecessarily to reveal an editable HTML Element.
+<br> If the document doesn't scroll, test passes.<br>
+<b>This demonstrates a bug: normally, focusing an element will select its contents.</b>
+<div style="width:2000px;height:2000px;"></div>
+If the document scrolls here, test fails.
+<div id="log"></div>
+</body>
+</html>
+<script>
+var test = async_test('focus to editable should not scroll');
+document.documentElement.addEventListener('focus', function() {
+ assert_equals(document.body.scrollTop, 0);
+ test.done();
+});
+test.step(function() {
+ document.documentElement.focus();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698