2010-11-25 01:57:58 +03:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
2011-06-29 22:22:39 +04:00
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
2010-11-25 01:57:58 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
2014-02-01 20:54:13 +04:00
|
|
|
<textarea id="t" rows="4" style="-moz-appearance: none"></textarea>
|
2010-11-25 01:57:58 +03:00
|
|
|
<script>
|
2011-08-12 20:21:35 +04:00
|
|
|
if (typeof(addLoadEvent) == 'undefined') {
|
|
|
|
_newCallStack = function(path) {
|
|
|
|
var rval = function () {
|
|
|
|
var callStack = arguments.callee.callStack;
|
|
|
|
for (var i = 0; i < callStack.length; i++) {
|
|
|
|
if (callStack[i].apply(this, arguments) === false) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
this[path] = null;
|
|
|
|
} catch (e) {
|
|
|
|
// pass
|
|
|
|
}
|
|
|
|
};
|
|
|
|
rval.callStack = [];
|
|
|
|
return rval;
|
|
|
|
};
|
|
|
|
function addLoadEvent(func) {
|
|
|
|
var existing = window["onload"];
|
|
|
|
var regfunc = existing;
|
|
|
|
if (!(typeof(existing) == 'function'
|
|
|
|
&& typeof(existing.callStack) == "object"
|
|
|
|
&& existing.callStack !== null)) {
|
|
|
|
regfunc = _newCallStack("onload");
|
|
|
|
if (typeof(existing) == 'function') {
|
|
|
|
regfunc.callStack.push(existing);
|
|
|
|
}
|
|
|
|
window["onload"] = regfunc;
|
|
|
|
}
|
|
|
|
regfunc.callStack.push(func);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2010-11-25 01:57:58 +03:00
|
|
|
addLoadEvent(function() {
|
|
|
|
var area = document.getElementById('t');
|
|
|
|
area.focus();
|
|
|
|
|
2012-09-06 09:43:21 +04:00
|
|
|
var domWindowUtils = SpecialPowers.getDOMWindowUtils(window);
|
2010-11-25 01:57:58 +03:00
|
|
|
|
|
|
|
// input raw characters
|
2014-10-07 14:01:50 +04:00
|
|
|
synthesizeCompositionChange(
|
2010-11-25 01:57:58 +03:00
|
|
|
{ composition:
|
|
|
|
{ string: "\u306D",
|
|
|
|
clauses: [
|
2015-01-28 09:27:33 +03:00
|
|
|
{ length: 1, attr: COMPOSITION_ATTR_RAW_CLAUSE }
|
2010-11-25 01:57:58 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
caret: { start: 1, length: 0 }
|
|
|
|
});
|
2014-10-07 14:01:50 +04:00
|
|
|
synthesizeCompositionChange(
|
2010-11-25 01:57:58 +03:00
|
|
|
{ composition:
|
|
|
|
{ string: "\u306D\u3053",
|
|
|
|
clauses: [
|
2015-01-28 09:27:33 +03:00
|
|
|
{ length: 2, attr: COMPOSITION_ATTR_RAW_CLAUSE }
|
2010-11-25 01:57:58 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
caret: { start: 2, length: 0 }
|
|
|
|
});
|
|
|
|
|
|
|
|
// convert
|
2014-10-07 14:01:50 +04:00
|
|
|
synthesizeCompositionChange(
|
2010-11-25 01:57:58 +03:00
|
|
|
{ composition:
|
|
|
|
{ string: "\u732B",
|
|
|
|
clauses: [
|
2015-01-28 09:27:33 +03:00
|
|
|
{ length: 1, attr: COMPOSITION_ATTR_SELECTED_CLAUSE }
|
2010-11-25 01:57:58 +03:00
|
|
|
]
|
|
|
|
},
|
|
|
|
caret: { start: 1, length: 0 }
|
|
|
|
});
|
|
|
|
|
|
|
|
// commit
|
2014-11-25 08:02:31 +03:00
|
|
|
synthesizeComposition({ type: "compositioncommitasis" });
|
2010-11-25 01:57:58 +03:00
|
|
|
|
|
|
|
document.body.clientWidth;
|
|
|
|
|
|
|
|
// undo
|
|
|
|
synthesizeKey("Z", {accelKey: true});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|