Bug 462892 - Add a mIsSynthetic member to nsIDocument r=roc

This commit is contained in:
Paul ADENOT 2011-08-09 08:35:00 -04:00
parent d3f69880aa
commit 1493cdedf4
5 changed files with 21 additions and 2 deletions

View File

@ -1692,6 +1692,10 @@ protected:
// True if we're an SVG document being used as an image.
PRPackedBool mIsBeingUsedAsImage;
// True is this document is synthetic : stand alone image, video, audio
// file, etc.
PRPackedBool mIsSyntheticDocument;
// The document's script global object, the object from which the
// document can get its script context and scope. This is the
// *inner* window object.

View File

@ -5919,6 +5919,13 @@ nsDocument::SetXmlStandalone(PRBool aXmlStandalone)
return IsHTML() ? NS_ERROR_DOM_NOT_SUPPORTED_ERR : NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsDocument::GetMozSyntheticDocument(PRBool *aSyntheticDocument)
{
*aSyntheticDocument = mIsSyntheticDocument;
return NS_OK;
}
NS_IMETHODIMP
nsDocument::GetXmlVersion(nsAString& aXmlVersion)
{

View File

@ -523,7 +523,7 @@ public:
virtual void NotifyPossibleTitleChange(PRBool aBoundTitleElement);
virtual void SetDocumentURI(nsIURI* aURI);
/**
* Set the principal responsible for this document.
*/

View File

@ -150,6 +150,8 @@ MediaDocument::Init()
getter_AddRefs(mStringBundle));
}
mIsSyntheticDocument = PR_TRUE;
return NS_OK;
}

View File

@ -62,7 +62,7 @@ interface nsIDOMLocation;
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/
[scriptable, uuid(d53c3d3d-2413-4abc-b54e-11c5c8380776)]
[scriptable, uuid(10034b87-384e-4e19-902c-c4edafb899be)]
interface nsIDOMDocument : nsIDOMNode
{
readonly attribute nsIDOMDocumentType doctype;
@ -316,6 +316,12 @@ interface nsIDOMDocument : nsIDOMNode
*/
readonly attribute DOMString contentType;
/**
* True if this document is synthetic : stand alone image, video, audio file,
* etc.
*/
readonly attribute boolean mozSyntheticDocument;
/**
* Returns the script element whose script is currently being processed.
*