mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
Bug 860123 - Use the right window's selection in some tests; r=ehsan
This commit is contained in:
parent
bbd7b55f9f
commit
1f98b00a32
@ -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
|
||||
|
@ -77,6 +77,7 @@ function testCollapsed(id, vPercent, startAt, expected) {
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user