From 020018865f1fcd1302d3422d32e43041d345c1a2 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Thu, 16 Sep 1999 23:30:51 +0000 Subject: [PATCH] Don't evaluate script tags inside an IFRAME tag since we support IFRAME's (partial fix for bug #5847) git-svn-id: svn://10.0.0.236/trunk@47863 18797224-902f-48f8-a5cc-f745e15eee43 --- .../html/document/src/nsHTMLContentSink.cpp | 17 +++++++++++++++-- .../html/document/src/nsHTMLContentSink.cpp | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 3553599abbd..e523acb70c7 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -215,6 +215,7 @@ public: nsVoidArray mContextStack; SinkContext* mCurrentContext; SinkContext* mHeadContext; + PRInt32 mNumOpenIFRAMES; nsString* mRef; nsScrollPreference mOriginalScrollPreference; @@ -1055,6 +1056,9 @@ SinkContext::OpenContainer(const nsIParserNode& aNode) case eHTMLTag_map: mSink->ProcessMAPTag(aNode, content); break; + case eHTMLTag_iframe: + mSink->mNumOpenIFRAMES++; + break; default: break; } @@ -1103,6 +1107,11 @@ SinkContext::CloseContainer(const nsIParserNode& aNode) result = CloseContainer(aNode); } } + + case eHTMLTag_iframe: + mSink->mNumOpenIFRAMES--; + break; + default: break; } @@ -1474,6 +1483,9 @@ SinkContext::FlushTags() parent->AppendChildTo(content, PR_FALSE); mStack[stackPos].mFlags |= APPENDED; + if (eHTMLTag_iframe == mStack[mStackPos].mType) { + mSink->mNumOpenIFRAMES--; + } stackPos--; } @@ -3321,8 +3333,9 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode) // that is measuring content creation time NS_STOP_STOPWATCH(mWatch) - // Don't process scripts that aren't JavaScript - if (isJavaScript) { + // Don't process scripts that aren't JavaScript and don't process + // scripts that are inside iframes + if (isJavaScript && !mNumOpenIFRAMES) { // If there is a SRC attribute... if (src.Length() > 0) { // Use the SRC attribute value to load the URL diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 3553599abbd..e523acb70c7 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -215,6 +215,7 @@ public: nsVoidArray mContextStack; SinkContext* mCurrentContext; SinkContext* mHeadContext; + PRInt32 mNumOpenIFRAMES; nsString* mRef; nsScrollPreference mOriginalScrollPreference; @@ -1055,6 +1056,9 @@ SinkContext::OpenContainer(const nsIParserNode& aNode) case eHTMLTag_map: mSink->ProcessMAPTag(aNode, content); break; + case eHTMLTag_iframe: + mSink->mNumOpenIFRAMES++; + break; default: break; } @@ -1103,6 +1107,11 @@ SinkContext::CloseContainer(const nsIParserNode& aNode) result = CloseContainer(aNode); } } + + case eHTMLTag_iframe: + mSink->mNumOpenIFRAMES--; + break; + default: break; } @@ -1474,6 +1483,9 @@ SinkContext::FlushTags() parent->AppendChildTo(content, PR_FALSE); mStack[stackPos].mFlags |= APPENDED; + if (eHTMLTag_iframe == mStack[mStackPos].mType) { + mSink->mNumOpenIFRAMES--; + } stackPos--; } @@ -3321,8 +3333,9 @@ HTMLContentSink::ProcessSCRIPTTag(const nsIParserNode& aNode) // that is measuring content creation time NS_STOP_STOPWATCH(mWatch) - // Don't process scripts that aren't JavaScript - if (isJavaScript) { + // Don't process scripts that aren't JavaScript and don't process + // scripts that are inside iframes + if (isJavaScript && !mNumOpenIFRAMES) { // If there is a SRC attribute... if (src.Length() > 0) { // Use the SRC attribute value to load the URL