/** Test for textbox resizing **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(() => SimpleTest.executeSoon(doTheTest));
// -1 means use the default value which is 'both', then test explicitly
// setting each possible value. var currentResize = -1; var currentBoxSizing = 0; var currentPointer = 0; var resizeTypes = [ "horizontal", "vertical", "none", "inherit", "both" ]; var boxSizingTypes = [ "", "border-box" ]; var pointerTypes = [ synthesizeMouse, synthesizeTouch]
function doTheTest() {
runTest(pointerTypes[currentPointer]);
}
function runTest(aPointerFunc) { var boxSizingText = " with box sizing " + (currentBoxSizing ? boxSizingTypes[currentBoxSizing] : "content-box");
vartextarea = $("textarea"); var rect = textarea.getBoundingClientRect(); var touch = aPointerFunc.name.match(/Touch/);
// -1 means use the default value of resize, i.e. "both" var type = (currentResize == -1) ? "both" : resizeTypes[currentResize];
// assume that the resizer is in the lower right corner
var newrect = textarea.getBoundingClientRect(); var hchange = (type == "both" || type == "horizontal"); var vchange = (type == "both" || type == "vertical");
is(Math.round(newrect.width), Math.round(rect.width + (hchange ? 50 : 0)),
type + " width has increased" + boxSizingText + " using " + aPointerFunc.name);
is(Math.round(newrect.height), Math.round(rect.height + (vchange ? 50 : 0)),
type + " height has increased" + boxSizingText + " using " + aPointerFunc.name);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.