This commit is contained in:
kipp%netscape.com 1998-10-02 21:59:59 +00:00
Родитель 2ec7f9cf29
Коммит 750a2e4ee6
2 изменённых файлов: 96 добавлений и 0 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -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,