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

Unified Diff: LayoutTests/editing/selection/resources/js-test-selection-shared.js

Issue 15732019: Revert 151179 "On IE and FireFox, they treats contenteditable="f..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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: LayoutTests/editing/selection/resources/js-test-selection-shared.js
diff --git a/LayoutTests/editing/selection/resources/js-test-selection-shared.js b/LayoutTests/editing/selection/resources/js-test-selection-shared.js
index 1268bfc99a8276b9401072a2c27a87e03e5ff212..ed7cbb3ada35e3de45c32662579fee586b9c6b4a 100644
--- a/LayoutTests/editing/selection/resources/js-test-selection-shared.js
+++ b/LayoutTests/editing/selection/resources/js-test-selection-shared.js
@@ -1,58 +1,3 @@
-function $(id) { return document.getElementById(id); }
-
-var selection= window.getSelection();
-
-function testCaretMotion(param) {
- var direction = param.direction;
- var granularity = param.granularity;
- var repeatCount = param.repeatCount || 1;
- var origin = param.origin;
- var originOffset = param.originOffset || 0;
- var target = param.target;
- var targetOffset = param.targetOffset || 0;
-
- if (direction == 'both') {
- testCaretMotion({
- 'direction': 'forward',
- 'granularity': granularity,
- 'repeatCount': repeatCount,
- 'origin': origin,
- 'originOffset': originOffset,
- 'target': target,
- 'targetOffset': targetOffset
- });
- testCaretMotion({
- 'direction': 'backward',
- 'granularity': granularity,
- 'repeatCount': repeatCount,
- 'origin': target,
- 'originOffset': targetOffset,
- 'target': origin,
- 'targetOffset': originOffset
- });
- return;
- }
-
- if (typeof origin == 'string')
- origin = $(origin);
-
- if (typeof target == 'string')
- target = $(target);
-
- if (originOffset < 0)
- originOffset = origin.firstChild.length + originOffset + 1;
-
- if (targetOffset < 0)
- targetOffset = target.firstChild.length + targetOffset + 1;
-
- selection.setPosition(origin.firstChild, originOffset);
- debug('Move ' + direction + ' ' + granularity + ' x ' + repeatCount);
- for (var i = 0; i < repeatCount; ++i)
- selection.modify("move", direction, granularity);
- shouldEvaluateTo('selection.anchorNode', target.firstChild);
- shouldEvaluateTo('selection.anchorOffset', targetOffset);
-}
-
function objectAsString(object, properties) {
var result = "[";
for (var x = 0; x < properties.length; x++) {

Powered by Google App Engine
This is Rietveld 408576698