зеркало из https://github.com/mozilla/pjs.git
Bug 491063 - Mixed mode warning dialog (and other dialog windows) is sometimes not rendered, r+sr=bz
This commit is contained in:
Родитель
705ebcb306
Коммит
d4e58eb985
|
@ -151,6 +151,9 @@ protected:
|
||||||
*/
|
*/
|
||||||
void DestroyImageLoadingContent();
|
void DestroyImageLoadingContent();
|
||||||
|
|
||||||
|
void ClearBrokenState() { mBroken = PR_FALSE; }
|
||||||
|
|
||||||
|
PRBool LoadingEnabled() { return mLoadingEnabled; }
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
* Struct used to manage the image observers.
|
* Struct used to manage the image observers.
|
||||||
|
|
|
@ -82,6 +82,7 @@ public:
|
||||||
|
|
||||||
static void ParseLinkTypes(const nsAString& aTypes, nsTArray<nsString>& aResult);
|
static void ParseLinkTypes(const nsAString& aTypes, nsTArray<nsString>& aResult);
|
||||||
|
|
||||||
|
void UpdateStyleSheetInternal() { UpdateStyleSheetInternal(nsnull); }
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @param aOldDocument should be non-null only if we're updating because we
|
* @param aOldDocument should be non-null only if we're updating because we
|
||||||
|
|
|
@ -148,6 +148,7 @@ public:
|
||||||
virtual PRInt32 IntrinsicState() const;
|
virtual PRInt32 IntrinsicState() const;
|
||||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||||
|
|
||||||
|
void MaybeLoadImage();
|
||||||
protected:
|
protected:
|
||||||
nsPoint GetXY();
|
nsPoint GetXY();
|
||||||
nsSize GetWidthHeight();
|
nsSize GetWidthHeight();
|
||||||
|
@ -550,18 +551,30 @@ nsHTMLImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::src)) {
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
ClearBrokenState();
|
||||||
nsAutoString uri;
|
nsContentUtils::AddScriptRunner(
|
||||||
if (GetAttr(kNameSpaceID_None, nsGkAtoms::src, uri)) {
|
new nsRunnableMethod<nsHTMLImageElement>(this,
|
||||||
// Note: no need to notify here; since we're just now being bound
|
&nsHTMLImageElement::MaybeLoadImage));
|
||||||
// we don't have any frames or anything yet.
|
|
||||||
LoadImage(uri, PR_FALSE, PR_FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsHTMLImageElement::MaybeLoadImage()
|
||||||
|
{
|
||||||
|
// Our base URI may have changed; claim that our URI changed, and the
|
||||||
|
// nsImageLoadingContent will decide whether a new image load is warranted.
|
||||||
|
// Note, check LoadingEnabled() after LoadImage call.
|
||||||
|
nsAutoString uri;
|
||||||
|
if (GetAttr(kNameSpaceID_None, nsGkAtoms::src, uri) &&
|
||||||
|
(NS_FAILED(LoadImage(uri, PR_FALSE, PR_TRUE)) ||
|
||||||
|
!LoadingEnabled())) {
|
||||||
|
CancelImageRequests(PR_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PRInt32
|
PRInt32
|
||||||
nsHTMLImageElement::IntrinsicState() const
|
nsHTMLImageElement::IntrinsicState() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -316,6 +316,7 @@ public:
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLInputElement,
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLInputElement,
|
||||||
nsGenericHTMLFormElement)
|
nsGenericHTMLFormElement)
|
||||||
|
|
||||||
|
void MaybeLoadImage();
|
||||||
protected:
|
protected:
|
||||||
// Helper method
|
// Helper method
|
||||||
nsresult SetValueInternal(const nsAString& aValue,
|
nsresult SetValueInternal(const nsAString& aValue,
|
||||||
|
@ -1966,6 +1967,19 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsHTMLInputElement::MaybeLoadImage()
|
||||||
|
{
|
||||||
|
// Our base URI may have changed; claim that our URI changed, and the
|
||||||
|
// nsImageLoadingContent will decide whether a new image load is warranted.
|
||||||
|
nsAutoString uri;
|
||||||
|
if (mType == NS_FORM_INPUT_IMAGE &&
|
||||||
|
GetAttr(kNameSpaceID_None, nsGkAtoms::src, uri) &&
|
||||||
|
(NS_FAILED(LoadImage(uri, PR_FALSE, PR_TRUE)) ||
|
||||||
|
!LoadingEnabled())) {
|
||||||
|
CancelImageRequests(PR_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsHTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
nsHTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
|
@ -1980,11 +1994,11 @@ nsHTMLInputElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
if (mType == NS_FORM_INPUT_IMAGE) {
|
if (mType == NS_FORM_INPUT_IMAGE) {
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
// Our base URI may have changed; claim that our URI changed, and the
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
// nsImageLoadingContent will decide whether a new image load is warranted.
|
||||||
nsAutoString uri;
|
if (HasAttr(kNameSpaceID_None, nsGkAtoms::src)) {
|
||||||
if (GetAttr(kNameSpaceID_None, nsGkAtoms::src, uri)) {
|
ClearBrokenState();
|
||||||
// Note: no need to notify here; since we're just now being bound
|
nsContentUtils::AddScriptRunner(
|
||||||
// we don't have any frames or anything yet.
|
new nsRunnableMethod<nsHTMLInputElement>(this,
|
||||||
LoadImage(uri, PR_FALSE, PR_FALSE);
|
&nsHTMLInputElement::MaybeLoadImage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,9 @@ nsHTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
UpdateStyleSheetInternal(nsnull);
|
nsContentUtils::AddScriptRunner(
|
||||||
|
new nsRunnableMethod<nsHTMLLinkElement>(this,
|
||||||
|
&nsHTMLLinkElement::UpdateStyleSheetInternal));
|
||||||
|
|
||||||
CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMLinkAdded"));
|
CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMLinkAdded"));
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,8 @@ public:
|
||||||
|
|
||||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||||
|
|
||||||
|
void StartObjectLoad() { StartObjectLoad(PR_TRUE); }
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLObjectElement,
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLObjectElement,
|
||||||
nsGenericHTMLFormElement)
|
nsGenericHTMLFormElement)
|
||||||
|
|
||||||
|
@ -224,9 +226,9 @@ nsHTMLObjectElement::BindToTree(nsIDocument *aDocument,
|
||||||
|
|
||||||
// If we already have all the children, start the load.
|
// If we already have all the children, start the load.
|
||||||
if (mIsDoneAddingChildren) {
|
if (mIsDoneAddingChildren) {
|
||||||
// Don't need to notify: We have no frames yet, since we weren't in a
|
nsContentUtils::AddScriptRunner(
|
||||||
// document
|
new nsRunnableMethod<nsHTMLObjectElement>(this,
|
||||||
StartObjectLoad(PR_FALSE);
|
&nsHTMLObjectElement::StartObjectLoad));
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsIDOMHTMLAppletElement.h"
|
#include "nsIDOMHTMLAppletElement.h"
|
||||||
#include "nsIDOMHTMLEmbedElement.h"
|
#include "nsIDOMHTMLEmbedElement.h"
|
||||||
|
#include "nsThreadUtils.h"
|
||||||
#ifdef MOZ_SVG
|
#ifdef MOZ_SVG
|
||||||
#include "nsIDOMGetSVGDocument.h"
|
#include "nsIDOMGetSVGDocument.h"
|
||||||
#include "nsIDOMSVGDocument.h"
|
#include "nsIDOMSVGDocument.h"
|
||||||
|
@ -129,6 +130,8 @@ public:
|
||||||
|
|
||||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||||
|
|
||||||
|
void StartObjectLoad() { StartObjectLoad(PR_TRUE); }
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLSharedObjectElement,
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLSharedObjectElement,
|
||||||
nsGenericHTMLElement)
|
nsGenericHTMLElement)
|
||||||
|
|
||||||
|
@ -252,9 +255,9 @@ nsHTMLSharedObjectElement::BindToTree(nsIDocument *aDocument,
|
||||||
|
|
||||||
// If we already have all the children, start the load.
|
// If we already have all the children, start the load.
|
||||||
if (mIsDoneAddingChildren) {
|
if (mIsDoneAddingChildren) {
|
||||||
// Don't need to notify: We have no frames yet, since we weren't in a
|
nsContentUtils::AddScriptRunner(
|
||||||
// document
|
new nsRunnableMethod<nsHTMLSharedObjectElement>(this,
|
||||||
StartObjectLoad(PR_FALSE);
|
&nsHTMLSharedObjectElement::StartObjectLoad));
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -241,7 +241,9 @@ nsHTMLStyleElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
UpdateStyleSheetInternal(nsnull);
|
nsContentUtils::AddScriptRunner(
|
||||||
|
new nsRunnableMethod<nsHTMLStyleElement>(this,
|
||||||
|
&nsHTMLStyleElement::UpdateStyleSheetInternal));
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5197,6 +5197,7 @@ public:
|
||||||
NS_IMETHOD OnStartContainer(imgIRequest *aRequest,
|
NS_IMETHOD OnStartContainer(imgIRequest *aRequest,
|
||||||
imgIContainer *aContainer);
|
imgIContainer *aContainer);
|
||||||
|
|
||||||
|
void MaybeLoadSVGImage();
|
||||||
private:
|
private:
|
||||||
// Invalidate users of the filter containing this element.
|
// Invalidate users of the filter containing this element.
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
|
@ -5301,6 +5302,16 @@ nsSVGFEImageElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
aValue, aNotify);
|
aValue, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsSVGFEImageElement::MaybeLoadSVGImage()
|
||||||
|
{
|
||||||
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href) &&
|
||||||
|
(NS_FAILED(LoadSVGImage(PR_FALSE, PR_TRUE)) ||
|
||||||
|
!LoadingEnabled())) {
|
||||||
|
CancelImageRequests(PR_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
@ -5312,11 +5323,10 @@ nsSVGFEImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
ClearBrokenState();
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
nsContentUtils::AddScriptRunner(
|
||||||
// Note: no need to notify here; since we're just now being bound
|
new nsRunnableMethod<nsSVGFEImageElement>(this,
|
||||||
// we don't have any frames or anything yet.
|
&nsSVGFEImageElement::MaybeLoadSVGImage));
|
||||||
LoadSVGImage(PR_FALSE, PR_FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -181,6 +181,16 @@ nsSVGImageElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
aValue, aNotify);
|
aValue, aNotify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nsSVGImageElement::MaybeLoadSVGImage()
|
||||||
|
{
|
||||||
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href) &&
|
||||||
|
(NS_FAILED(LoadSVGImage(PR_FALSE, PR_TRUE)) ||
|
||||||
|
!LoadingEnabled())) {
|
||||||
|
CancelImageRequests(PR_TRUE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
nsIContent* aBindingParent,
|
nsIContent* aBindingParent,
|
||||||
|
@ -192,11 +202,10 @@ nsSVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
if (HasAttr(kNameSpaceID_XLink, nsGkAtoms::href)) {
|
||||||
// Our base URI may have changed; claim that our URI changed, and the
|
ClearBrokenState();
|
||||||
// nsImageLoadingContent will decide whether a new image load is warranted.
|
nsContentUtils::AddScriptRunner(
|
||||||
// Note: no need to notify here; since we're just now being bound
|
new nsRunnableMethod<nsSVGImageElement>(this,
|
||||||
// we don't have any frames or anything yet.
|
&nsSVGImageElement::MaybeLoadSVGImage));
|
||||||
LoadSVGImage(PR_FALSE, PR_FALSE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -90,6 +90,7 @@ public:
|
||||||
|
|
||||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||||
|
|
||||||
|
void MaybeLoadSVGImage();
|
||||||
protected:
|
protected:
|
||||||
nsresult LoadSVGImage(PRBool aForce, PRBool aNotify);
|
nsresult LoadSVGImage(PRBool aForce, PRBool aNotify);
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,9 @@ nsSVGStyleElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
UpdateStyleSheetInternal(nsnull);
|
nsContentUtils::AddScriptRunner(
|
||||||
|
new nsRunnableMethod<nsSVGStyleElement>(this,
|
||||||
|
&nsSVGStyleElement::UpdateStyleSheetInternal));
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include "nsUnicharUtils.h"
|
#include "nsUnicharUtils.h"
|
||||||
#include "nsParserUtils.h"
|
#include "nsParserUtils.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
|
#include "nsThreadUtils.h"
|
||||||
|
|
||||||
class nsXMLStylesheetPI : public nsXMLProcessingInstruction,
|
class nsXMLStylesheetPI : public nsXMLProcessingInstruction,
|
||||||
public nsStyleLinkElement
|
public nsStyleLinkElement
|
||||||
|
@ -123,7 +124,9 @@ nsXMLStylesheetPI::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||||
aCompileEventHandlers);
|
aCompileEventHandlers);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
UpdateStyleSheetInternal(nsnull);
|
nsContentUtils::AddScriptRunner(
|
||||||
|
new nsRunnableMethod<nsXMLStylesheetPI>(this,
|
||||||
|
&nsXMLStylesheetPI::UpdateStyleSheetInternal));
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<img>
|
||||||
|
<input type="image">
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<img src="http://www.foo oo.com">
|
||||||
|
<input type="image" src="http://www.foo oo.com">
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,2 +1,3 @@
|
||||||
== background-image-zoom-1.html background-image-zoom-1-ref.html
|
== background-image-zoom-1.html background-image-zoom-1-ref.html
|
||||||
== image-zoom-1.html image-zoom-1-ref.html
|
== image-zoom-1.html image-zoom-1-ref.html
|
||||||
|
== invalid-url-image-1.html invalid-url-image-1-ref.html
|
||||||
|
|
Загрузка…
Ссылка в новой задаче