Add test for bug 583219. r=bzbarsky

This commit is contained in:
L. David Baron 2011-03-29 20:46:13 -07:00
parent ae4c8905b4
commit 6d2667f933
3 changed files with 73 additions and 0 deletions

View File

@ -172,6 +172,7 @@ _TEST_FILES = test_acid3_test46.html \
test_shorthand_property_getters.html \
test_style_struct_copy_constructors.html \
test_system_font_serialization.html \
test_transitions_and_zoom.html \
test_transitions_cancel_near_end.html \
test_transitions_computed_values.html \
test_transitions_computed_value_combinations.html \

View File

@ -0,0 +1,50 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=583219
-->
<head>
<title>Test for Bug 583219</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style type="text/css">
#display {
-moz-transition: margin-left 1s linear;
}
</style>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=583219">Mozilla Bug 583219</a>
<p id="display"></p>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 583219 **/
var p = document.getElementById("display");
var cs = getComputedStyle(p, "");
cs.marginLeft;
p.addEventListener("transitionend", TransitionEndHandler, false);
p.style.marginLeft = "100px";
cs.marginLeft;
SpecialPowers.setFullZoom(window, 2.0)
SimpleTest.waitForExplicitFinish();
function TransitionEndHandler(event) {
ok(true, "transition has completed");
is(event.propertyName, "margin-left", "event.propertyName");
is(cs.marginLeft, "100px", "value of margin-left");
SpecialPowers.setFullZoom(window, 1.0)
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

View File

@ -148,6 +148,15 @@ SpecialPowers.prototype = {
.getInterface(Ci.nsIDOMWindow)
.QueryInterface(Ci.nsIDOMChromeWindow);
},
_getDocShell: function(window) {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
},
_getMUDV: function(window) {
return this._getDocShell(window).contentViewer
.QueryInterface(Ci.nsIMarkupDocumentViewer);
},
_getAutoCompletePopup: function(window) {
return this._getTopChromeWindow(window).document
.getElementById("PopupAutoComplete");
@ -175,6 +184,19 @@ SpecialPowers.prototype = {
removeEventListener(type, listener, capture);
},
getFullZoom: function(window) {
return this._getMUDV(window).fullZoom;
},
setFullZoom: function(window, zoom) {
this._getMUDV(window).fullZoom = zoom;
},
getTextZoom: function(window) {
return this._getMUDV(window).textZoom;
},
setTextZoom: function(window, zoom) {
this._getMUDV(window).textZoom = zoom;
},
createSystemXHR: function() {
return Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Ci.nsIXMLHttpRequest);