Bug 1103157 (Part 1) - Add HAS_TRANSPARENCY and IS_ANIMATED imgIRequest flags. r=tn

This commit is contained in:
Seth Fowler 2014-11-24 23:42:43 -08:00
parent 626d39ccdc
commit d6721af14c
3 changed files with 15 additions and 3 deletions

View File

@ -19,7 +19,7 @@ interface nsIPrincipal;
* @version 0.1
* @see imagelib2
*/
[scriptable, builtinclass, uuid(dc61f0ea-4139-4c2a-ae69-cec82d33e089)]
[scriptable, builtinclass, uuid(83a7708b-5c35-409f-bab3-7fc08be6a264)]
interface imgIRequest : nsIRequest
{
/**
@ -54,6 +54,10 @@ interface imgIRequest : nsIRequest
* completely decoded.
*
* STATUS_DECODE_COMPLETE: The whole image has been decoded.
*
* STATUS_IS_ANIMATED: The image is animated.
*
* STATUS_HAS_TRANSPARENCY: The image is partially or completely transparent.
*/
//@{
const long STATUS_NONE = 0x0;
@ -63,6 +67,8 @@ interface imgIRequest : nsIRequest
const long STATUS_DECODE_STARTED = 0x8;
const long STATUS_FRAME_COMPLETE = 0x10;
const long STATUS_DECODE_COMPLETE = 0x20;
const long STATUS_IS_ANIMATED = 0x40;
const long STATUS_HAS_TRANSPARENCY = 0x80;
//@}
/**

View File

@ -152,6 +152,12 @@ ProgressTracker::GetImageStatus() const
if (mProgress & FLAG_LOAD_COMPLETE) {
status |= imgIRequest::STATUS_LOAD_COMPLETE;
}
if (mProgress & FLAG_IS_ANIMATED) {
status |= imgIRequest::STATUS_IS_ANIMATED;
}
if (mProgress & FLAG_HAS_TRANSPARENCY) {
status |= imgIRequest::STATUS_HAS_TRANSPARENCY;
}
if (mProgress & FLAG_HAS_ERROR) {
status |= imgIRequest::STATUS_ERROR;
}

View File

@ -34,8 +34,8 @@ enum {
FLAG_LOAD_COMPLETE = 1u << 4, // STATUS_LOAD_COMPLETE
FLAG_ONLOAD_BLOCKED = 1u << 5,
FLAG_ONLOAD_UNBLOCKED = 1u << 6,
FLAG_IS_ANIMATED = 1u << 7,
FLAG_HAS_TRANSPARENCY = 1u << 8,
FLAG_IS_ANIMATED = 1u << 7, // STATUS_IS_ANIMATED
FLAG_HAS_TRANSPARENCY = 1u << 8, // STATUS_HAS_TRANSPARENCY
FLAG_IS_MULTIPART = 1u << 9,
FLAG_LAST_PART_COMPLETE = 1u << 10,
FLAG_HAS_ERROR = 1u << 11 // STATUS_ERROR