mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Backed out changeset 17dcafc58287 (bug 1205027) for wpt windows-1251.html permafail on Windows. r=backout
This commit is contained in:
parent
3e45c9df89
commit
144882c03c
@ -790,30 +790,15 @@ nsImageFrame::EnsureIntrinsicSizeAndRatio()
|
||||
} else {
|
||||
// image request is null or image size not known, probably an
|
||||
// invalid image specified
|
||||
// - make the image big enough for the icon (it may not be
|
||||
// used if inline alt expansion is used instead)
|
||||
if (!(GetStateBits() & NS_FRAME_GENERATED_CONTENT)) {
|
||||
bool imageBroken = false;
|
||||
// check for broken images. valid null images (eg. img src="") are
|
||||
// not considered broken because they have no image requests
|
||||
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
|
||||
if (imageLoader) {
|
||||
nsCOMPtr<imgIRequest> currentRequest;
|
||||
imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
|
||||
getter_AddRefs(currentRequest));
|
||||
uint32_t imageStatus;
|
||||
imageBroken =
|
||||
currentRequest &&
|
||||
NS_SUCCEEDED(currentRequest->GetImageStatus(&imageStatus)) &&
|
||||
(imageStatus & imgIRequest::STATUS_ERROR);
|
||||
}
|
||||
// invalid image specified. make the image big enough for the "broken" icon
|
||||
if (imageBroken) {
|
||||
nscoord edgeLengthToUse =
|
||||
nsPresContext::CSSPixelsToAppUnits(
|
||||
ICON_SIZE + (2 * (ICON_PADDING + ALT_BORDER_WIDTH)));
|
||||
mIntrinsicSize.width.SetCoordValue(edgeLengthToUse);
|
||||
mIntrinsicSize.height.SetCoordValue(edgeLengthToUse);
|
||||
mIntrinsicRatio.SizeTo(1, 1);
|
||||
}
|
||||
nscoord edgeLengthToUse =
|
||||
nsPresContext::CSSPixelsToAppUnits(
|
||||
ICON_SIZE + (2 * (ICON_PADDING + ALT_BORDER_WIDTH)));
|
||||
mIntrinsicSize.width.SetCoordValue(edgeLengthToUse);
|
||||
mIntrinsicSize.height.SetCoordValue(edgeLengthToUse);
|
||||
mIntrinsicRatio.SizeTo(1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,45 +0,0 @@
|
||||
"use strict";
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const IMG_BYTES = atob(
|
||||
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAA" +
|
||||
"DUlEQVQImWNgY2P7DwABOgESJhRQtgAAAABJRU5ErkJggg==");
|
||||
|
||||
function handleRequest(request, response) {
|
||||
response.processAsync();
|
||||
getObjectState("context", function(obj) {
|
||||
let ctx;
|
||||
if (obj == null) {
|
||||
ctx = {
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsISupports))
|
||||
return this;
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
};
|
||||
ctx.wrappedJSObject = ctx;
|
||||
|
||||
ctx.promise = new Promise(resolve => {
|
||||
ctx.resolve = resolve;
|
||||
});
|
||||
|
||||
setObjectState("context", ctx);
|
||||
} else {
|
||||
ctx = obj.wrappedJSObject;
|
||||
}
|
||||
Promise.resolve(ctx).then(next);
|
||||
});
|
||||
|
||||
function next(ctx) {
|
||||
if (request.queryString.indexOf("continue") >= 0) {
|
||||
ctx.resolve();
|
||||
}
|
||||
|
||||
ctx.promise.then(() => {
|
||||
response.setHeader("Content-Type", "image/png");
|
||||
response.write(IMG_BYTES);
|
||||
response.finish();
|
||||
});
|
||||
}
|
||||
}
|
@ -14,7 +14,6 @@ support-files =
|
||||
file_Dolske.png
|
||||
file_IconTestServer.sjs
|
||||
file_LoadingImageReference.png
|
||||
file_SlowImage.sjs
|
||||
bug1174521.html
|
||||
|
||||
[test_bug240933.html]
|
||||
@ -107,7 +106,6 @@ skip-if = os=='win'
|
||||
[test_image_selection_2.html]
|
||||
[test_invalidate_during_plugin_paint.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' # b2g(plugins not supported) b2g-debug(plugins not supported) b2g-desktop(plugins not supported)
|
||||
[test_intrinsic_size_on_loading.html]
|
||||
[test_movement_by_characters.html]
|
||||
[test_movement_by_words.html]
|
||||
# Disable the caret movement by word test on Linux because the shortcut keys
|
||||
|
@ -1,53 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1205027
|
||||
-->
|
||||
<head>
|
||||
<title>Test for images intrinsic size while load is pending</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<style>
|
||||
body { margin: 0; }
|
||||
img { display: block; }
|
||||
</style>
|
||||
<script>
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var initialOffsetTop;
|
||||
var finalOffsetTop;
|
||||
|
||||
function report() {
|
||||
finalOffsetTop = marker.offsetTop;
|
||||
is(initialOffsetTop, 0, "initial offsetTop: " + initialOffsetTop);
|
||||
is(finalOffsetTop, 8, "final offsetTop: " + finalOffsetTop);
|
||||
ok(initialOffsetTop < finalOffsetTop, "offsetTop should get larger.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function fail() {
|
||||
ok(false, "image loading should not fail.");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="report();">
|
||||
<!-- Bunch of tiny images: -->
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
<img src="file_SlowImage.sjs" onerror="fail();">
|
||||
|
||||
<div id="marker">Marker div</div>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1205027">Mozilla Bug 1205027</a>
|
||||
<script>
|
||||
initialOffsetTop = marker.offsetTop;
|
||||
// prompt the sjs "server" to proceed to serve data to our <img> elements
|
||||
var img = new Image();
|
||||
img.onerror = fail;
|
||||
img.src = "file_SlowImage.sjs?continue";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user