Skip to content

Commit

Permalink
Bug 226099 [RFE] Highlight "<![CDATA[" and matching "]]>" in View Source
Browse files Browse the repository at this point in the history
patch by [email protected] r=bz sr=rbs
  • Loading branch information
timeless%mozdev.org committed Oct 12, 2004
1 parent 44c8f82 commit cd79c19
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion parser/htmlparser/src/nsHTMLTokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ NS_IMPL_RELEASE(nsHTMLTokenizer)

mFlags |= (aCommand==eViewSource)? NS_IPARSER_FLAG_VIEW_SOURCE:NS_IPARSER_FLAG_VIEW_NORMAL;

NS_ASSERTION(!(mFlags & NS_IPARSER_FLAG_XML) ||
(mFlags & NS_IPARSER_FLAG_VIEW_SOURCE),
"Why isn't this XML document going through our XML parser?");

mTokenAllocator = nsnull;
mTokenScanPos = 0;
mPreserveTarget = eHTMLTag_unknown;
Expand Down Expand Up @@ -736,8 +740,10 @@ nsresult nsHTMLTokenizer::ConsumeStartTag(PRUnichar aChar,CToken*& aToken,nsScan
/* Now that that's over with, we have one more problem to solve.
In the case that we just read a <SCRIPT> or <STYLE> tags, we should go and
consume all the content itself.
But XML doesn't treat these tags differently, so we shouldn't if the
document is XML.
*/
if(NS_SUCCEEDED(result)) {
if(NS_SUCCEEDED(result) && !(mFlags & NS_IPARSER_FLAG_XML)) {
CStartToken* theStartToken = NS_STATIC_CAST(CStartToken*,aToken);
//XXX - Find a better soution to record content
if(!(mFlags & NS_IPARSER_FLAG_PRESERVE_CONTENT) &&
Expand Down

0 comments on commit cd79c19

Please sign in to comment.