mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-06-17 06:29:30 +00:00
#442: M1347639
This commit is contained in:
parent
71e9386e75
commit
dfaeb3f24a
|
@ -56,6 +56,9 @@ public:
|
||||||
}
|
}
|
||||||
return nsXMLElement::PreHandleEvent(aVisitor);
|
return nsXMLElement::PreHandleEvent(aVisitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~nsGenConImageContent();
|
virtual ~nsGenConImageContent();
|
||||||
|
|
|
@ -868,7 +868,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
||||||
// We use the principal of aDocument to avoid having to QI |this| an extra
|
// We use the principal of aDocument to avoid having to QI |this| an extra
|
||||||
// time. It should always be the same as the principal of this node.
|
// time. It should always be the same as the principal of this node.
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
nsIContent* thisContent = AsContent();
|
||||||
MOZ_ASSERT(thisContent &&
|
MOZ_ASSERT(thisContent &&
|
||||||
thisContent->NodePrincipal() == aDocument->NodePrincipal(),
|
thisContent->NodePrincipal() == aDocument->NodePrincipal(),
|
||||||
"Principal mismatch?");
|
"Principal mismatch?");
|
||||||
|
@ -909,8 +909,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
||||||
|
|
||||||
// Not blocked. Do the load.
|
// Not blocked. Do the load.
|
||||||
RefPtr<imgRequestProxy>& req = PrepareNextRequest(aImageLoadType);
|
RefPtr<imgRequestProxy>& req = PrepareNextRequest(aImageLoadType);
|
||||||
nsCOMPtr<nsIContent> content =
|
nsIContent* content = AsContent();
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
|
||||||
nsresult rv = nsContentUtils::LoadImage(aNewURI, aDocument,
|
nsresult rv = nsContentUtils::LoadImage(aNewURI, aDocument,
|
||||||
aDocument->NodePrincipal(),
|
aDocument->NodePrincipal(),
|
||||||
aDocument->GetDocumentURI(),
|
aDocument->GetDocumentURI(),
|
||||||
|
@ -1048,10 +1047,7 @@ nsImageLoadingContent::UpdateImageState(bool aNotify)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
nsIContent* thisContent = AsContent();
|
||||||
if (!thisContent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mLoading = mBroken = mUserDisabled = mSuppressed = false;
|
mLoading = mBroken = mUserDisabled = mSuppressed = false;
|
||||||
|
|
||||||
|
@ -1115,29 +1111,19 @@ nsImageLoadingContent::UseAsPrimaryRequest(imgRequestProxy* aRequest,
|
||||||
nsIDocument*
|
nsIDocument*
|
||||||
nsImageLoadingContent::GetOurOwnerDoc()
|
nsImageLoadingContent::GetOurOwnerDoc()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIContent> thisContent =
|
return AsContent()->OwnerDoc();
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
|
||||||
NS_ENSURE_TRUE(thisContent, nullptr);
|
|
||||||
|
|
||||||
return thisContent->OwnerDoc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIDocument*
|
nsIDocument*
|
||||||
nsImageLoadingContent::GetOurCurrentDoc()
|
nsImageLoadingContent::GetOurCurrentDoc()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIContent> thisContent =
|
return AsContent()->GetComposedDoc();
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
|
||||||
NS_ENSURE_TRUE(thisContent, nullptr);
|
|
||||||
|
|
||||||
return thisContent->GetComposedDoc();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame*
|
nsIFrame*
|
||||||
nsImageLoadingContent::GetOurPrimaryFrame()
|
nsImageLoadingContent::GetOurPrimaryFrame()
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIContent> thisContent =
|
return AsContent()->GetPrimaryFrame();
|
||||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
|
||||||
return thisContent->GetPrimaryFrame();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsPresContext* nsImageLoadingContent::GetFramePresContext()
|
nsPresContext* nsImageLoadingContent::GetFramePresContext()
|
||||||
|
@ -1159,8 +1145,7 @@ nsImageLoadingContent::StringToURI(const nsAString& aSpec,
|
||||||
NS_PRECONDITION(aURI, "Null out param");
|
NS_PRECONDITION(aURI, "Null out param");
|
||||||
|
|
||||||
// (1) Get the base URI
|
// (1) Get the base URI
|
||||||
nsCOMPtr<nsIContent> thisContent = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
nsIContent* thisContent = AsContent();
|
||||||
NS_ASSERTION(thisContent, "An image loading content must be an nsIContent");
|
|
||||||
nsCOMPtr<nsIURI> baseURL = thisContent->GetBaseURI();
|
nsCOMPtr<nsIURI> baseURL = thisContent->GetBaseURI();
|
||||||
|
|
||||||
// (2) Get the charset
|
// (2) Get the charset
|
||||||
|
|
|
@ -214,6 +214,10 @@ protected:
|
||||||
// The nsContentPolicyType we would use for this ImageLoadType
|
// The nsContentPolicyType we would use for this ImageLoadType
|
||||||
static nsContentPolicyType PolicyTypeForLoad(ImageLoadType aImageLoadType);
|
static nsContentPolicyType PolicyTypeForLoad(ImageLoadType aImageLoadType);
|
||||||
|
|
||||||
|
// Get ourselves as an nsIContent*. Not const because some of the callers
|
||||||
|
// want a non-const nsIContent.
|
||||||
|
virtual nsIContent* AsContent() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Struct used to manage the image observers.
|
* Struct used to manage the image observers.
|
||||||
|
|
|
@ -350,6 +350,9 @@ protected:
|
||||||
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
||||||
const nsAttrValue* aValue, bool aNotify) override;
|
const nsAttrValue* aValue, bool aNotify) override;
|
||||||
|
|
||||||
|
// Override for nsImageLoadingContent.
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
// This is a weak reference that this element and the HTMLFormElement
|
// This is a weak reference that this element and the HTMLFormElement
|
||||||
// cooperate in maintaining.
|
// cooperate in maintaining.
|
||||||
HTMLFormElement* mForm;
|
HTMLFormElement* mForm;
|
||||||
|
|
|
@ -1254,6 +1254,11 @@ protected:
|
||||||
*/
|
*/
|
||||||
bool IsPopupBlocked() const;
|
bool IsPopupBlocked() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override for nsImageLoadingContent.
|
||||||
|
*/
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
nsCOMPtr<nsIControllers> mControllers;
|
nsCOMPtr<nsIControllers> mControllers;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -235,6 +235,10 @@ public:
|
||||||
return GetContentDocument();
|
return GetContentDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Override for nsImageLoadingContent.
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Calls LoadObject with the correct arguments to start the plugin load.
|
* Calls LoadObject with the correct arguments to start the plugin load.
|
||||||
|
|
|
@ -192,6 +192,10 @@ public:
|
||||||
return GetContentDocument();
|
return GetContentDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Override for nsImageLoadingContent.
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~HTMLSharedObjectElement();
|
virtual ~HTMLSharedObjectElement();
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,9 @@ protected:
|
||||||
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
||||||
virtual StringAttributesInfo GetStringInfo() override;
|
virtual StringAttributesInfo GetStringInfo() override;
|
||||||
|
|
||||||
|
// Override for nsImageLoadingContent.
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
enum { RESULT, HREF };
|
enum { RESULT, HREF };
|
||||||
nsSVGString mStringAttributes[2];
|
nsSVGString mStringAttributes[2];
|
||||||
static StringInfo sStringInfo[2];
|
static StringInfo sStringInfo[2];
|
||||||
|
|
|
@ -83,6 +83,9 @@ protected:
|
||||||
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
||||||
virtual StringAttributesInfo GetStringInfo() override;
|
virtual StringAttributesInfo GetStringInfo() override;
|
||||||
|
|
||||||
|
// Override for nsImageLoadingContent.
|
||||||
|
nsIContent* AsContent() override { return this; }
|
||||||
|
|
||||||
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
||||||
nsSVGLength2 mLengthAttributes[4];
|
nsSVGLength2 mLengthAttributes[4];
|
||||||
static LengthInfo sLengthInfo[4];
|
static LengthInfo sLengthInfo[4];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user