Skip to content

Commit

Permalink
Bug 860123 - Use the right window's selection in some tests; r=ehsan
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbkap committed Sep 3, 2013
1 parent bbd7b55 commit 1f98b00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/libeditor/base/tests/test_bug646194.xul
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ function runTest() {
var i = document.getElementById("i");
i.focus();
var win = i.contentWindow;
var doc = i.contentDocument;
var t = doc.getElementById("t");
t.focus();
// put the caret at the end
getSelection().collapse(t.firstChild, 11);
win.getSelection().collapse(t.firstChild, 11);
// Simulate pression Option+Delete on Mac
// We do things this way because not every platform can invoke this
Expand Down
1 change: 1 addition & 0 deletions layout/base/tests/test_scroll_selection_into_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
var c = document.getElementById("c" + id);
var target = document.getElementById("target" + id);
if (target.contentDocument) {
selection = target.contentWindow.getSelection().QueryInterface(Components.interfaces.nsISelectionPrivate);
target = target.contentDocument.getElementById("target" + id);
}
selection.collapse(target.parentNode, 0);
Expand Down

0 comments on commit 1f98b00

Please sign in to comment.