diff --git a/htmlparser/src/CNavDTD.cpp b/htmlparser/src/CNavDTD.cpp
index 6a0e13c53ec..4511fa7b816 100644
--- a/htmlparser/src/CNavDTD.cpp
+++ b/htmlparser/src/CNavDTD.cpp
@@ -783,9 +783,9 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
return result;
}
else {
- // If you're here then we have seen a /noscript.
- // After handling the text token intentionally
- // fall thro' such that /noscript gets handled.
+ // If you're here then we have either seen a /noscript,
+ // or /noframes, or /iframe. After handling the text token
+ // intentionally fall thro' to handle the current end token.
CTextToken theTextToken(mScratch);
result=HandleStartToken(&theTextToken);
@@ -840,6 +840,7 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
switch(theTag) {
case eHTMLTag_html:
+ case eHTMLTag_iframe:
case eHTMLTag_noframes:
case eHTMLTag_noscript:
case eHTMLTag_script:
diff --git a/htmlparser/src/nsElementTable.cpp b/htmlparser/src/nsElementTable.cpp
index e11b420a976..afc73b3a110 100644
--- a/htmlparser/src/nsElementTable.cpp
+++ b/htmlparser/src/nsElementTable.cpp
@@ -98,7 +98,9 @@ TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added
TagList gFormKids={1,{eHTMLTag_keygen}};
TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
-TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
+TagList gHtmlKids={10,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head, eHTMLTag_map,
+ eHTMLTag_noscript,eHTMLTag_noframes, eHTMLTag_script,eHTMLTag_newline,
+ eHTMLTag_whitespace, eHTMLTag_iframe}}; // Added iframe to fix bug 149887
TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
TagList gLabelKids={1,{eHTMLTag_span}};
diff --git a/parser/htmlparser/src/CNavDTD.cpp b/parser/htmlparser/src/CNavDTD.cpp
index 6a0e13c53ec..4511fa7b816 100644
--- a/parser/htmlparser/src/CNavDTD.cpp
+++ b/parser/htmlparser/src/CNavDTD.cpp
@@ -783,9 +783,9 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
return result;
}
else {
- // If you're here then we have seen a /noscript.
- // After handling the text token intentionally
- // fall thro' such that /noscript gets handled.
+ // If you're here then we have either seen a /noscript,
+ // or /noframes, or /iframe. After handling the text token
+ // intentionally fall thro' to handle the current end token.
CTextToken theTextToken(mScratch);
result=HandleStartToken(&theTextToken);
@@ -840,6 +840,7 @@ nsresult CNavDTD::HandleToken(CToken* aToken,nsIParser* aParser){
switch(theTag) {
case eHTMLTag_html:
+ case eHTMLTag_iframe:
case eHTMLTag_noframes:
case eHTMLTag_noscript:
case eHTMLTag_script:
diff --git a/parser/htmlparser/src/nsElementTable.cpp b/parser/htmlparser/src/nsElementTable.cpp
index e11b420a976..afc73b3a110 100644
--- a/parser/htmlparser/src/nsElementTable.cpp
+++ b/parser/htmlparser/src/nsElementTable.cpp
@@ -98,7 +98,9 @@ TagList gFontKids={3,{eHTMLTag_legend,eHTMLTag_table,eHTMLTag_text}}; // Added
TagList gFormKids={1,{eHTMLTag_keygen}};
TagList gFramesetKids={3,{eHTMLTag_frame,eHTMLTag_frameset,eHTMLTag_noframes}};
-TagList gHtmlKids={9,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head,eHTMLTag_map,eHTMLTag_noscript,eHTMLTag_noframes,eHTMLTag_script,eHTMLTag_newline,eHTMLTag_whitespace}};
+TagList gHtmlKids={10,{eHTMLTag_body,eHTMLTag_frameset,eHTMLTag_head, eHTMLTag_map,
+ eHTMLTag_noscript,eHTMLTag_noframes, eHTMLTag_script,eHTMLTag_newline,
+ eHTMLTag_whitespace, eHTMLTag_iframe}}; // Added iframe to fix bug 149887
TagList gHeadKids={8,{eHTMLTag_base,eHTMLTag_bgsound,eHTMLTag_link,eHTMLTag_meta,eHTMLTag_script,eHTMLTag_style,eHTMLTag_title,eHTMLTag_noembed}};
TagList gLabelKids={1,{eHTMLTag_span}};