diff --git a/mozilla/layout/generic/nsFrameFrame.cpp b/mozilla/layout/generic/nsFrameFrame.cpp index 947ac6110d6..499acbae8a2 100644 --- a/mozilla/layout/generic/nsFrameFrame.cpp +++ b/mozilla/layout/generic/nsFrameFrame.cpp @@ -116,6 +116,10 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext, + nsIContent* aChild, + nsIAtom* aAttribute, + PRInt32 aHint); NS_IMETHOD VerifyTree() const; nscoord GetBorderWidth(nsIPresContext& aPresContext); PRBool IsInline(); @@ -165,6 +169,9 @@ public: nsFrameborder GetFrameBorder(PRBool aStandardMode); PRInt32 GetMarginWidth(nsIPresContext* aPresContext, nsIContent* aContent); PRInt32 GetMarginHeight(nsIPresContext* aPresContext, nsIContent* aContent); + + nsresult ReloadURL(); + protected: nsresult CreateWebShell(nsIPresContext& aPresContext, const nsSize& aSize); @@ -354,6 +361,21 @@ nsHTMLFrameOuterFrame::VerifyTree() const return NS_OK; } +NS_IMETHODIMP +nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext, + nsIContent* aChild, + nsIAtom* aAttribute, + PRInt32 aHint) +{ + if (nsHTMLAtoms::src == aAttribute) { + printf("got a request\n"); + if (nsnull != mFirstChild) { + ((nsHTMLFrameInnerFrame*)mFirstChild)->ReloadURL(); + } + } + return NS_OK; +} + nsresult NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame, nsIFrame*& aResult) @@ -755,6 +777,32 @@ nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext, return rv; } +nsresult +nsHTMLFrameInnerFrame::ReloadURL() +{ + nsresult rv = NS_OK; + nsIContent* content; + GetParentContent(content); + if (nsnull != content) { + + nsAutoString url; + GetURL(content, url); + + if (nsnull != mWebShell) { + mCreatingViewer=PR_TRUE; + + // load the document + nsString absURL; + TempMakeAbsURL(content, url, absURL); + + rv = mWebShell->LoadURL(absURL, // URL string + nsnull); // Post Data + } + NS_RELEASE(content); + } + return rv; +} + void nsHTMLFrameInnerFrame::GetDesiredSize(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState, diff --git a/mozilla/layout/html/document/src/nsFrameFrame.cpp b/mozilla/layout/html/document/src/nsFrameFrame.cpp index 947ac6110d6..499acbae8a2 100644 --- a/mozilla/layout/html/document/src/nsFrameFrame.cpp +++ b/mozilla/layout/html/document/src/nsFrameFrame.cpp @@ -116,6 +116,10 @@ public: nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext, + nsIContent* aChild, + nsIAtom* aAttribute, + PRInt32 aHint); NS_IMETHOD VerifyTree() const; nscoord GetBorderWidth(nsIPresContext& aPresContext); PRBool IsInline(); @@ -165,6 +169,9 @@ public: nsFrameborder GetFrameBorder(PRBool aStandardMode); PRInt32 GetMarginWidth(nsIPresContext* aPresContext, nsIContent* aContent); PRInt32 GetMarginHeight(nsIPresContext* aPresContext, nsIContent* aContent); + + nsresult ReloadURL(); + protected: nsresult CreateWebShell(nsIPresContext& aPresContext, const nsSize& aSize); @@ -354,6 +361,21 @@ nsHTMLFrameOuterFrame::VerifyTree() const return NS_OK; } +NS_IMETHODIMP +nsHTMLFrameOuterFrame::AttributeChanged(nsIPresContext* aPresContext, + nsIContent* aChild, + nsIAtom* aAttribute, + PRInt32 aHint) +{ + if (nsHTMLAtoms::src == aAttribute) { + printf("got a request\n"); + if (nsnull != mFirstChild) { + ((nsHTMLFrameInnerFrame*)mFirstChild)->ReloadURL(); + } + } + return NS_OK; +} + nsresult NS_NewHTMLFrameOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame, nsIFrame*& aResult) @@ -755,6 +777,32 @@ nsHTMLFrameInnerFrame::Reflow(nsIPresContext& aPresContext, return rv; } +nsresult +nsHTMLFrameInnerFrame::ReloadURL() +{ + nsresult rv = NS_OK; + nsIContent* content; + GetParentContent(content); + if (nsnull != content) { + + nsAutoString url; + GetURL(content, url); + + if (nsnull != mWebShell) { + mCreatingViewer=PR_TRUE; + + // load the document + nsString absURL; + TempMakeAbsURL(content, url, absURL); + + rv = mWebShell->LoadURL(absURL, // URL string + nsnull); // Post Data + } + NS_RELEASE(content); + } + return rv; +} + void nsHTMLFrameInnerFrame::GetDesiredSize(nsIPresContext* aPresContext, const nsHTMLReflowState& aReflowState,