mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 860123 - Use the right window's selection in some tests; r=ehsan
This commit is contained in:
parent
c0d9c60eca
commit
9225fd4fbb
@ -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…
Reference in New Issue
Block a user