2010-07-30 03:15:38 -07:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is HTML5 View Source code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2011
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Henri Sivonen <hsivonen@iki.fi>
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
2011-11-01 08:27:36 -07:00
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::StartPlainText()
|
|
|
|
{
|
|
|
|
stateSave = NS_HTML5TOKENIZER_PLAINTEXT;
|
|
|
|
}
|
|
|
|
|
2010-07-30 03:15:38 -07:00
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::EnableViewSource(nsHtml5Highlighter* aHighlighter)
|
|
|
|
{
|
|
|
|
mViewSource = aHighlighter;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
nsHtml5Tokenizer::FlushViewSource()
|
|
|
|
{
|
|
|
|
return mViewSource->FlushOps();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-11-30 09:44:31 -08:00
|
|
|
nsHtml5Tokenizer::StartViewSource(const nsAutoString& aTitle)
|
2010-07-30 03:15:38 -07:00
|
|
|
{
|
2011-11-30 09:44:31 -08:00
|
|
|
mViewSource->Start(aTitle);
|
2010-07-30 03:15:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::EndViewSource()
|
|
|
|
{
|
|
|
|
mViewSource->End();
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errWarnLtSlashInRcdata()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-11-01 04:33:11 -07:00
|
|
|
// The null checks below annotated NS_LIKELY are not actually necessary.
|
|
|
|
|
2011-11-01 04:33:11 -07:00
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errUnquotedAttributeValOrNull(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
switch (c) {
|
|
|
|
case '<':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeLt");
|
|
|
|
return;
|
|
|
|
case '`':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeGrave");
|
|
|
|
return;
|
|
|
|
case '\'':
|
|
|
|
case '"':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeQuote");
|
|
|
|
return;
|
|
|
|
case '=':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeEquals");
|
|
|
|
return;
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errLtOrEqualsOrGraveInUnquotedAttributeOrNull(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
switch (c) {
|
|
|
|
case '=':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeStartEquals");
|
|
|
|
return;
|
|
|
|
case '<':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeStartLt");
|
|
|
|
return;
|
|
|
|
case '`':
|
|
|
|
mViewSource->AddErrorToCurrentNode("errUnquotedAttributeStartGrave");
|
|
|
|
return;
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errBadCharBeforeAttributeNameOrNull(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
if (c == '<') {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errBadCharBeforeAttributeNameLt");
|
|
|
|
} else if (c == '=') {
|
|
|
|
errEqualsSignBeforeAttributeName();
|
|
|
|
} else if (c != 0xFFFD) {
|
|
|
|
errQuoteBeforeAttributeName(c);
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errBadCharAfterLt(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errBadCharAfterLt");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errQuoteOrLtInAttributeNameOrNull(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
if (c == '<') {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errLtInAttributeName");
|
|
|
|
} else if (c != 0xFFFD) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errQuoteInAttributeName");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::maybeErrAttributesOnEndTag(nsHtml5HtmlAttributes* attrs)
|
|
|
|
{
|
|
|
|
if (mViewSource && attrs->getLength() != 0) {
|
|
|
|
/*
|
|
|
|
* When an end tag token is emitted with attributes, that is a parse
|
|
|
|
* error.
|
|
|
|
*/
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentRun("maybeErrAttributesOnEndTag");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::maybeErrSlashInEndTag(bool selfClosing)
|
|
|
|
{
|
|
|
|
if (mViewSource && selfClosing && endTag) {
|
|
|
|
mViewSource->AddErrorToCurrentSlash("maybeErrSlashInEndTag");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUnichar
|
|
|
|
nsHtml5Tokenizer::errNcrNonCharacter(PRUnichar ch)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrNonCharacter");
|
|
|
|
}
|
|
|
|
return ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-11-07 01:29:17 -08:00
|
|
|
nsHtml5Tokenizer::errAstralNonCharacter(PRInt32 ch)
|
2011-11-01 04:33:11 -07:00
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-04 06:36:29 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrNonCharacter");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUnichar
|
|
|
|
nsHtml5Tokenizer::errNcrControlChar(PRUnichar ch)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrControlChar");
|
|
|
|
}
|
|
|
|
return ch;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errGarbageAfterLtSlash()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errGarbageAfterLtSlash");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errLtSlashGt()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errLtSlashGt");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errCharRefLacksSemicolon()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errCharRefLacksSemicolon");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoDigitsInNCR()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNoDigitsInNCR");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errGtInSystemId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errGtInSystemId");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errGtInPublicId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errGtInPublicId");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNamelessDoctype()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNamelessDoctype");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errConsecutiveHyphens()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errConsecutiveHyphens");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errPrematureEndOfComment()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errPrematureEndOfComment");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errBogusComment()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errBogusComment");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errSlashNotFollowedByGt()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentSlash("errSlashNotFollowedByGt");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoSpaceBetweenAttributes()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNoSpaceBetweenAttributes");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errAttributeValueMissing()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errAttributeValueMissing");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEqualsSignBeforeAttributeName()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errEqualsSignBeforeAttributeName");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errLtGt()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errLtGt");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errProcessingInstruction()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errProcessingInstruction");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errUnescapedAmpersandInterpretedAsCharacterReference()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentAmpersand("errUnescapedAmpersandInterpretedAsCharacterReference");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNotSemicolonTerminated()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNotSemicolonTerminated");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoNamedCharacterMatch()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentAmpersand("errNoNamedCharacterMatch");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errQuoteBeforeAttributeName(PRUnichar c)
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errQuoteBeforeAttributeName");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errExpectedPublicId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errExpectedPublicId");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errBogusDoctype()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errBogusDoctype");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrSurrogate()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrSurrogate");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrCr()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrCr");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrInC1Range()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrInC1Range");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInPublicId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInPublicId");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInComment()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInComment");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInDoctype()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInDoctype");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInAttributeValue()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInAttributeValue");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInAttributeName()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInAttributeName");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofWithoutGt()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofWithoutGt");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInTagName()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInTagName");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInEndTag()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInEndTag");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofAfterLt()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofAfterLt");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrOutOfRange()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrOutOfRange");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrUnassigned()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrUnassigned");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errDuplicateAttribute()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errDuplicateAttribute");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errEofInSystemId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentRun("errEofInSystemId");
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errExpectedSystemId()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errExpectedSystemId");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errMissingSpaceBeforeDoctypeName()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errMissingSpaceBeforeDoctypeName");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errHyphenHyphenBang()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errHyphenHyphenBang");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrControlChar()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrControlChar");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNcrZero()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_UNLIKELY(mViewSource)) {
|
2011-11-01 04:33:11 -07:00
|
|
|
mViewSource->AddErrorToCurrentNode("errNcrZero");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoSpaceBetweenDoctypeSystemKeywordAndQuote()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNoSpaceBetweenDoctypeSystemKeywordAndQuote");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoSpaceBetweenPublicAndSystemIds()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNoSpaceBetweenPublicAndSystemIds");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Tokenizer::errNoSpaceBetweenDoctypePublicKeywordAndQuote()
|
|
|
|
{
|
2011-11-01 04:33:11 -07:00
|
|
|
if (NS_LIKELY(mViewSource)) {
|
|
|
|
mViewSource->AddErrorToCurrentNode("errNoSpaceBetweenDoctypePublicKeywordAndQuote");
|
|
|
|
}
|
2011-11-01 04:33:11 -07:00
|
|
|
}
|