Backed out changeset ec2ffd935bd9 a=test-bustage

This commit is contained in:
Josh Matthews 2010-09-11 21:04:09 -04:00
parent 3576dc896d
commit 37d6567b57
8 changed files with 1 additions and 154 deletions

View File

@ -1750,4 +1750,3 @@ GK_ATOM(_moz_windows_classic, "-moz-windows-classic")
GK_ATOM(_moz_touch_enabled, "-moz-touch-enabled")
GK_ATOM(_moz_maemo_classic, "-moz-maemo-classic")
GK_ATOM(_moz_menubar_drag, "-moz-menubar-drag")
GK_ATOM(_moz_device_pixel_ratio, "-moz-device-pixel-ratio")

View File

@ -1791,9 +1791,6 @@ CSSParserImpl::ParseMediaQueryExpression(nsMediaQuery* aQuery)
expr->mValue.GetIntValue() > 1)
rv = PR_FALSE;
break;
case nsMediaFeature::eFloat:
rv = ParseNonNegativeVariant(expr->mValue, VARIANT_NUMBER, nsnull);
break;
case nsMediaFeature::eIntRatio:
{
// Two integers separated by '/', with optional whitespace on

View File

@ -249,15 +249,6 @@ nsMediaExpression::Matches(nsPresContext *aPresContext,
cmp = DoCompare(actual.GetIntValue(), required.GetIntValue());
}
break;
case nsMediaFeature::eFloat:
{
NS_ASSERTION(actual.GetUnit() == eCSSUnit_Number,
"bad actual value");
NS_ASSERTION(required.GetUnit() == eCSSUnit_Number,
"bad required value");
cmp = DoCompare(actual.GetFloatValue(), required.GetFloatValue());
}
break;
case nsMediaFeature::eIntRatio:
{
NS_ASSERTION(actual.GetUnit() == eCSSUnit_Array &&
@ -431,15 +422,6 @@ nsMediaQuery::AppendToString(nsAString& aString) const
// written without anything extra.
expr.mValue.AppendToString(eCSSProperty_z_index, aString);
break;
case nsMediaFeature::eFloat:
{
NS_ASSERTION(expr.mValue.GetUnit() == eCSSUnit_Number,
"bad unit");
// Use 'line-height' as a property that takes float values
// written in the normal way.
expr.mValue.AppendToString(eCSSProperty_line_height, aString);
}
break;
case nsMediaFeature::eIntRatio:
{
NS_ASSERTION(expr.mValue.GetUnit() == eCSSUnit_Array,

View File

@ -185,6 +185,7 @@ GetDeviceAspectRatio(nsPresContext* aPresContext, const nsMediaFeature*,
return MakeArray(GetDeviceSize(aPresContext), aResult);
}
static nsresult
GetColor(nsPresContext* aPresContext, const nsMediaFeature*,
nsCSSValue& aResult)
@ -260,15 +261,6 @@ GetGrid(nsPresContext* aPresContext, const nsMediaFeature*,
return NS_OK;
}
static nsresult
GetDevicePixelRatio(nsPresContext* aPresContext, const nsMediaFeature*,
nsCSSValue& aResult)
{
float ratio = aPresContext->CSSPixelsToDevPixels(1.0f);
aResult.SetFloatValue(ratio, eCSSUnit_Number);
return NS_OK;
}
static nsresult
GetSystemMetric(nsPresContext* aPresContext, const nsMediaFeature* aFeature,
nsCSSValue& aResult)
@ -385,13 +377,6 @@ nsMediaFeatures::features[] = {
},
// Mozilla extensions
{
&nsGkAtoms::_moz_device_pixel_ratio,
nsMediaFeature::eMinMaxAllowed,
nsMediaFeature::eFloat,
{ nsnull },
GetDevicePixelRatio
},
{
&nsGkAtoms::_moz_scrollbar_start_backward,
nsMediaFeature::eMinMaxNotAllowed,

View File

@ -63,7 +63,6 @@ struct nsMediaFeature {
// was given (in addition to the types listed below).
eLength, // values are such that nsCSSValue::IsLengthUnit() is true
eInteger, // values are eCSSUnit_Integer
eFloat, // values are eCSSUnit_Number
eBoolInteger,// values are eCSSUnit_Integer (0, -0, or 1 only)
eIntRatio, // values are eCSSUnit_Array of two eCSSUnit_Integer
eResolution, // values are in eCSSUnit_Inch (for dpi) or

View File

@ -153,7 +153,6 @@ _TEST_FILES = test_acid3_test46.html \
test_media_queries.html \
test_media_queries_dynamic.html \
test_media_queries_dynamic_xbl.html \
test_moz_device_pixel_ratio.html \
test_namespace_rule.html \
test_of_type_selectors.xhtml \
test_parse_rule.html \

View File

@ -26,13 +26,6 @@ SimpleTest.waitForExplicitFinish();
var iframe;
function getZoomRatio() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
return utils.screenPixelsPerCSSPixel;
}
function run() {
iframe = document.getElementById("subdoc");
var subdoc = iframe.contentDocument;
@ -336,26 +329,6 @@ function run() {
should_apply("not all and (max-device-aspect-ratio: " + low_dar_2 + ")");
expression_should_not_be_parseable("max-device-aspect-ratio");
var real_dpr = 1.0 * getZoomRatio();
var high_dpr = 1.1 * getZoomRatio();
var low_dpr = 0.9 * getZoomRatio();
should_apply("all and (max--moz-device-pixel-ratio: " + real_dpr + ")");
should_apply("all and (min--moz-device-pixel-ratio: " + real_dpr + ")");
should_not_apply("not all and (max--moz-device-pixel-ratio: " + real_dpr + ")");
should_not_apply("not all and (min--moz-device-pixel-ratio: " + real_dpr + ")");
should_apply("all and (min--moz-device-pixel-ratio: " + low_dpr + ")");
should_apply("all and (max--moz-device-pixel-ratio: " + high_dpr + ")");
should_not_apply("all and (max--moz-device-pixel-ratio: " + low_dpr + ")");
should_not_apply("all and (min--moz-device-pixel-ratio: " + high_dpr + ")");
should_apply("not all and (max--moz-device-pixel-ratio: " + low_dpr + ")");
should_apply("not all and (min--moz-device-pixel-ratio: " + high_dpr + ")");
should_apply("(-moz-device-pixel-ratio: " + real_dpr + ")");
should_not_apply("(-moz-device-pixel-ratio: " + high_dpr + ")");
should_not_apply("(-moz-device-pixel-ratio: " + low_dpr + ")");
should_apply("(-moz-device-pixel-ratio)");
expression_should_not_be_parseable("min--moz-device-pixel-ratio");
expression_should_not_be_parseable("max--moz-device-pixel-ratio");
features = [ "max-aspect-ratio", "device-aspect-ratio" ];
for (i in features) {
feature = features[i];

View File

@ -1,87 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=474356
-->
<head>
<title>Test for Bug 474356</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<style>.zoom-test { visibility: hidden; }</style>
<style><!-- placeholder for dynamic additions --></style>
</head>
<body onload="run()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=474356">Mozilla Bug 474356</a>
<div id="content" style="display: none">
</div>
<script type="text/javascript">
</script>
<pre id="test">
<div id="zoom1" class="zoom-test"></div>
<div id="zoom2" class="zoom-test"></div>
<div id="zoom3" class="zoom-test"></div>
<script class="testbody" type="application/javascript">
/** Test for Bug 474356 **/
SimpleTest.waitForExplicitFinish();
function run() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
viewer = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShell)
.contentViewer
.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);
function zoom(factor) {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
viewer.fullZoom = factor;
}
function isVisible(divName) {
return window.getComputedStyle(document.getElementById(divName), null).visibility == "visible";
}
function getZoomRatio() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
return utils ? utils.screenPixelsPerCSSPixel : 1.0;
}
var screenPixelsPerCSSPixel = getZoomRatio();
var baseRatio = 1.0 * screenPixelsPerCSSPixel;
var doubleRatio = 2.0 * screenPixelsPerCSSPixel;
var halfRatio = 0.5 * screenPixelsPerCSSPixel;
var styleElem = document.getElementsByTagName("style")[1];
styleElem.textContent =
["@media all and (-moz-device-pixel-ratio: " + baseRatio + ") {",
"#zoom1 { visibility: visible; }",
"}",
"@media all and (-moz-device-pixel-ratio: " + doubleRatio + ") {",
"#zoom2 { visibility: visible; }",
"}",
"@media all and (-moz-device-pixel-ratio: " + halfRatio + ") {",
"#zoom3 { visibility: visible; }",
"}"
].join("\n");
ok(isVisible("zoom1"), "Base ratio rule should apply at base zoom level");
ok(!isVisible("zoom2") && !isVisible("zoom3"), "no other rules should apply");
zoom(2 * screenPixelsPerCSSPixel);
ok(isVisible("zoom2"), "Double ratio rule should apply at double zoom level");
ok(!isVisible("zoom1") && !isVisible("zoom3"), "no other rules should apply");
zoom(0.5 * screenPixelsPerCSSPixel);
ok(isVisible("zoom3"), "Half ratio rule should apply at half zoom level");
ok(!isVisible("zoom1") && !isVisible("zoom2"), "no other rules should apply");
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>